public boolean verifyPhone(String phone) {
String regex = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(17[013678])|(18[0,5-9]))\\d{8}$";
if (phone.length() != 11) {
System.out.println("手机号应为11位数");
} else {
Pattern p = Pattern.compile(regex);
Matcher m = p.matcher(phone);
boolean isMatch = m.matches();
if (isMatch) {
log.info("手机号格式正确");
return true;
} else {
log.info("手机号格式错误");
}
}
return false;
}