手机号验证正则表达式

阅读更多

    public static boolean checkPhoneNumber(String mobiles) {
        Pattern pattern = null;
        Matcher matcher = null;
        boolean result = false;
        pattern = Pattern.compile("^[1][3,4,5,8][0-9]{9}$"); // 验证手机号
        matcher = pattern.matcher(mobiles);
        result = matcher.matches();
        return result;
    }

 

你可能感兴趣的:(android,pattern,java)