Java 手机号正则

原创
2018/05/03 10:01
阅读数 228
public static boolean isChinaMobile(String str) {
	    if(str != null && !str.trim().equals("") && str.length() == 11) {
            String regExp = "^((13[0-9])|(14[5-9])|(15([0-3]|[5-9]))|(16[5|6])|(17[0135678])|(18[0-9])|(19[8-9]))\\d{8}$";
	        Pattern p = Pattern.compile(regExp);
	        Matcher matcher = p.matcher(str);
	        boolean isMatch = matcher.matches();
	        if (isMatch) {
	            return true;
            }
        }
        return false;
    }
展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
0 评论
0 收藏
0
分享
返回顶部
顶部