Mobile phone number verification regular expression

    public static boolean checkPhoneNumber(String mobiles) {
        Pattern pattern = null;
        Matches matches = zero;
        boolean result = false;
        pattern = Pattern.compile("^[1][3,4,5,8][0-9]{9}$"); // Verify phone number
        matcher = pattern.matcher (mobiles);
        result = matcher.matches();
        return result;
    }

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326269241&siteId=291194637