判断邮箱,邮箱的正则表达式

邮箱的正则表达式判断了

1 public class EmailUtil {
2     public static boolean isEmail(String email) {
3         String str = "^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$";
4         Pattern p = Pattern.compile(str);
5         Matcher m = p.matcher(email);
6 
7         return m.matches();
8     }
9 }

 

直接使用就ok了

posted on 2016-08-18 15:08  oooo呼呼  阅读(555)  评论(0编辑  收藏  举报