判断email格式

1 public static boolean isEmail(String str) {
2 Pattern p = Pattern.compile("^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$");
3 Matcher m = p.matcher(str);
4 if (m.matches()) {
5 return true;
6 }
7 return false;
8 }
原文地址:https://www.cnblogs.com/lilihuang/p/2098384.html