JAVA使用邮箱的正则表达式代码

package 第五章字符串;


public class text102ye {


public static void main(String[] args) {
// TODO Auto-ge 
     String  regex="";
   //电子邮件  
     String check = 
    "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)"
    + "?\\.)+[a-zA-Z]{2,}$"; 
     String   ff="[email protected]";
     boolean ff2=ff.matches(check);
     System.out.println(ff2);
}


}

猜你喜欢

转载自blog.csdn.net/u014426593/article/details/78907923