public static void main(String[] args) {
checkMail();
}
private static void checkMail() {
String email = "sdfEFD1_23@jk2s677.com.cn";
boolean b = email.matches("[a-zA-Z0-9_]+@[0-9a-z]+(\\.[a-z]+)+");
System.out.println(b);
}
matches()函数--验证邮箱地址--"[a-zA-Z0-9_]+@[0-9a-z]+(.\\[a-z]+)+"
最新推荐文章于 2022-08-27 18:15:48 发布