java 对前台传递的手机号进行验证,是否是正确号段。
public static boolean isMobile(String phone) {
Pattern p = null;
Matcher m = null;
boolean b = false;
p = Pattern.compile("^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$");
m = p.matcher(phone);
b = m.matches();
return b;
}