手机号的检测

    public boolean checkPhone(String phoneNum){
        Pattern pattern = Pattern.compile("1[1-9][0-9]{9}");
        Matcher matcher = pattern.matcher(phoneNum);

        if (matcher.find()){
            return true;
        }
        return false;
    }

 

posted @ 2017-08-19 00:53  halo-漾  阅读(165)  评论(0编辑  收藏  举报