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 }