大家好,又见面了,我是你们的朋友全栈君。
手机号校验
public static boolean CheckMobilePhoneNum(String phoneNum) {
String regex = "^(1[3-9]\\d{9}$)";
if (phoneNum.length() == 11) {
Pattern p = Pattern.compile(regex);
Matcher m = p.matcher(phoneNum);
if (m.matches()) {
return true;
}
}
return false;
}
}
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/142739.html原文链接:https://javaforall.net