Code
1 public static boolean isEmail(String str)
2 {
3 if(str == null)
4 return false;
5 Pattern pattern = Pattern.compile("^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$");
6 return pattern.matcher(str).matches();
7 }
1 public static boolean isEmail(String str)
2 {
3 if(str == null)
4 return false;
5 Pattern pattern = Pattern.compile("^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$");
6 return pattern.matcher(str).matches();
7 }