判断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 }

posted on 2011-07-05 16:08  还有什么  阅读(185)  评论(0)    收藏  举报

导航