我看了网上很多验证邮箱的正则格式,最后到网易邮箱注册查看了邮箱的规则,再重写了这个程序,以后邮箱校验的时候使用 //验证email地址 // 字母数字下划线,首位以字母开头6-18位,在不包括@163.com public static void test5(){ String str = "y_f785@126.com"; Matcher m = Pattern.compile("^[a-zA-Z][\\w_]{5,17}@(163|126