邮箱的正则表达式判断了
1 public class EmailUtil { 2 public static boolean isEmail(String email) { 3 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})(\]?)$"; 4 Pattern p = Pattern.compile(str); 5 Matcher m = p.matcher(email); 6 7 return m.matches(); 8 } 9 }
直接使用就ok了