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; }