java正则,
分享于 点击 42774 次 点评:178
java正则,
正则:
public static final String REGEX_EMAIL = "^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$";
public static final String REGEX_MOBILE = "^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\\d{8}$";
boolean b = Pattern.matches(REGEX_MOBILE, phone); boolean matches = Pattern.matches(REGEX_EMAIL, email);
if (!b) { sb.append("手机号:" + phone + " 不符合规范!"); flag = false; }
相关文章
- 暂无相关文章
用户点评