email合法性check

来源:互联网 发布:设计动画的软件 编辑:程序博客网 时间:2024/06/10 05:50
  1.      /**
  2.      * Email检查<br>
  3.      * <br>
  4.      * @param pInput     要检查的字符串<br>
  5.      * @return boolean   检查结果<br>
  6.      */
  7.     public static boolean isEmail (String pInput) {
  8.         if(pInput == null){
  9.             return false;
  10.         }
  11.         String regEx = "([//w[_-][//.]]+@+[//w[_-]]+//.+[A-Za-z]{2,3})|([//"
  12.             + "w[_-][//.]]+@+[//w[_-]]+//.+[//w[_-]]+//.+[A-Za-z]{2,3})|"
  13.             + "([//w[_-][//.]]+@+[//w[_-]]+//.+[//w[_-]]+//.+[//w[_-]]+"
  14.             + "//.+[A-Za-z]{2,3})";
  15.         Pattern p = Pattern.compile(regEx);
  16.         Matcher matcher = p.matcher(pInput);
  17.         return matcher.matches();
  18.     }
原创粉丝点击