发文时间:2019.11.28
public static boolean isMobile(String str) {
String regex1 = "^[1][3,4,5,6,7,8,9][0-9]{9}$";// 未来手机号可能出现100开头的,需要适当调整
Pattern p = Pattern.compile(regex1);
Matcher m = p.matcher(str);
boolean isMatch = m.matches();
return isMatch;
}
public static void main(String[] args) {
String mobile = "13906203838";
System.out.println(isMobile(mobile));
}