//是否是邮箱
//是否是手机号
public static boolean isEmail(String strEmail) {
String strPattern ="\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*";
Pattern p = Pattern.compile(strPattern);
Matcher m = p.matcher(strEmail);
if (m.matches()) {
return true;
}else {
return false;
}
}
//是否是手机号
public static booleanisCellphone(String str) {
Pattern pattern = Pattern.compile("1[0-9]{10}");
Matcher matcher =pattern.matcher(str);
if (matcher.matches()) {
return true;
}else {
return false;
}
}