1,检验邮件格式是否正确
public final static String REG_email = "^[\\w\\d]+@[\\w\\d]+(\\.[\\w\\d]+)+$";Pattern pattern = Pattern.compile(RegExpression.REG_email);Matcher m = pattern.matcher(email);if (!m.find()) { System.out.println("Wrong email format.");}
本文共 299 字,大约阅读时间需要 1 分钟。
1,检验邮件格式是否正确
public final static String REG_email = "^[\\w\\d]+@[\\w\\d]+(\\.[\\w\\d]+)+$";Pattern pattern = Pattern.compile(RegExpression.REG_email);Matcher m = pattern.matcher(email);if (!m.find()) { System.out.println("Wrong email format.");}
转载于:https://www.cnblogs.com/IcanFixIt/p/4550502.html