/**
* 注册工具类,判断手机号、邮箱。。。
* @author wxl
*
*/
public class RegisterUtil {
public static boolean isMobileNum(String mobiles) {
Pattern p = Pattern
.compile("^((1[0-9][0-9])|(15[^4,\\D])|(18[0-9]))\\d{8}$");
Matcher m = p.matcher(mobiles);
System.out.println(m.matches() + "---");
return m.matches();
}
public static boolean isEmail(String email) {
String str = "^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$";
Pattern p = Pattern.compile(str);
Matcher m = p.matcher(email);
return m.matches();
}
}
* 注册工具类,判断手机号、邮箱。。。
* @author wxl
*
*/
public class RegisterUtil {
public static boolean isMobileNum(String mobiles) {
Pattern p = Pattern
.compile("^((1[0-9][0-9])|(15[^4,\\D])|(18[0-9]))\\d{8}$");
Matcher m = p.matcher(mobiles);
System.out.println(m.matches() + "---");
return m.matches();
}
public static boolean isEmail(String email) {
String str = "^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$";
Pattern p = Pattern.compile(str);
Matcher m = p.matcher(email);
return m.matches();
}
}