手机号正则

Posted Dota_小川

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了手机号正则相关的知识,希望对你有一定的参考价值。

Pattern p = Pattern.compile("^((13[0-9])|(15[^4,\\D])|(18[0,2,3,5-9])|(17[0-9])|(14[5,7]))\\d{8}$");
        Matcher m = p.matcher(mobile);

        // 手机号匹配失败
        if (!m.matches()) {
            return false;
        }

        return true;

 

以上是关于手机号正则的主要内容,如果未能解决你的问题,请参考以下文章