/** * 确认字符串是否为email格式 * * @param strEmail * @return */ public static boolean isEmail(String strEmail) { String strPattern = "^[a-zA-Z][\\w\\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\\w\\.-]*[a-zA-Z0-9]\\.[a-zA-Z][a-zA-Z\\.]*[a-zA-Z]$"; Pattern p = Pattern.compile(strPattern); Matcher m = p.matcher(strEmail); return m.matches(); }原文链接:https://www.f2er.com/regex/361633.html