public
class
Test{
static
void
main(String[] args) {
String str =
"010-86835215"
;
System.out.println("str 是 一 个 正 确 的 电 话 号 码 ? 答 案 是 :
"+str.matches("
0
\\d{
2
}-\\d{
8
}"));
}
//源代码片段来自云代码http://yuncode.net