数字
boolean b="000-000-000".matches("\\d{3}-\\d{3}-\\d{3}");
System.out.println(b);
以下为所有字符
boolean b = "阿三A-sss-000"
.matches("(\\d{3}||\\D{3}||\\w{3}||\\W{3}||^\\w{3}||^\\d{3}||^\\D{3}||^\\W{3})
-(\\d{3}||\\D{3}||\\w{3}||\\W{3}||^\\w{3}||^\\d{3}||^\\D{3}||^\\W{3})
-(\\d{3}||\\D{3}||\\w{3}||\\W{3}||^\\w{3}||^\\d{3}||^\\D{3}||^\\W{3})");
System.out.println(b);
如需其他的请私聊