邮箱正则表达式
public static boolean validateEmail(String email){
if (null==email || "".equals(email)){
return false;
}
String regEx1 = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$";
Pattern p = Pattern.compile(regEx1);
Matcher m = p.matcher(email);
if(m.matches()){
return true;
}else{
return false;
}
}
public static void main(String[] args) {
String email = "1388932@qq。cn";
System.out.println(validateEmail(email));
}