尝试
String s = "*** test@gmail.com&&^ test2@gmail.com((& "; Matcher m = Pattern.compile("[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+").matcher(s); while (m.find()) { System.out.println(m.group()); }
尝试
String s = "*** test@gmail.com&&^ test2@gmail.com((& "; Matcher m = Pattern.compile("[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+").matcher(s); while (m.find()) { System.out.println(m.group()); }