/** * 验证手机号码 * * @param mobiles * @return */ public static boolean isMobileNO(String mobiles) { boolean isValid = false; CharSequence inputStr = mobiles; // 正则表达式 String phone = "^1[34578]\\d{9}$"; Pattern pattern = Pattern.compile(phone); Matcher matcher = pattern.matcher(inputStr); if (matcher.matches()) { isValid = true; } return isValid; }