java最新手机号正则校验

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/qq_40053398/article/details/89010409

手机号校验

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;
	}
}

猜你喜欢

转载自blog.csdn.net/qq_40053398/article/details/89010409
今日推荐