java验证邮箱

使用java验证邮箱的格式是否符合要求的代码:
1 public boolean isEmail(final String searchPhrase){
2         final String check = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$";
3         final Pattern regex = Pattern.compile(check);
4         final Matcher matcher = regex.matcher(searchPhrase);
5         return matcher.matches();
6     }


posted on 2008-11-20 15:54 育平 阅读(1212) 评论(1)  编辑  收藏

评论

# re: java验证邮箱[未登录] 2012-05-27 14:52 s

s  回复  更多评论   


只有注册用户登录后才能发表评论。


网站导航:
 
<2008年11月>
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456

导航

统计

常用链接

留言簿(2)

随笔档案

搜索

最新评论

阅读排行榜

评论排行榜