/** * 手机号号段校验, * 第1位:1; * 第2位:{3、4、5、6、7、8}任意数字; * 第3—11位:0—9任意数字 * * @param str * @return */ public static boolean telPhoneNumber(String str) { if (str != null && str.length() == 11) { Pattern compile = Pattern.compile("^1[3|4|5|6|7|8][0-9]\\d{8}$"); Matcher matcher = compile.matcher(str); return matcher.matches(); } return false; }
Android验证手机号码的
最新推荐文章于 2024-05-13 15:30:58 发布