正则表达式验证
private static String phoneRegex = "^[1][0-9]{10}$";
/**
* 手机号校验
* @param phoneNumber
* @return
*/
public static boolean isValidatePhoneNumber(String phoneNumber) {
if (StringUtil.isBlank(phoneNumber)){
return false;
}
// 定义手机号格式的正则表达式
Pattern compile = Pattern.compile(phoneRegex);
Pattern pattern = compile;
Matcher matcher = pattern.matcher(phoneNumber);
return matcher.matches();
}