|
@@ -11,7 +11,7 @@ import java.util.regex.Pattern;
|
|
|
*/
|
|
|
public class DomainUtils {
|
|
|
|
|
|
- private static final Pattern email = Pattern.compile("[a-z_A-Z0-9\\-]+@[a-zA-Z\\-]+[\\.(a-zA-Z\\-)]+");
|
|
|
+ private static final Pattern email = Pattern.compile("[a-z_A-Z0-9\\-.]+@[a-zA-Z\\-]+[.(a-zA-Z\\-)]+");
|
|
|
|
|
|
private static final Pattern domainPattern = Pattern.compile("((http://)|(https://))?(www\\.)?([0-9a-zA-Z\\-_]+(\\.[a-zA-Z]+){1,2})(/.+)?");
|
|
|
|
|
@@ -38,7 +38,7 @@ public class DomainUtils {
|
|
|
}
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
- List<String> domain = getDomain("https://www.baidu.com.pro你好http://baidu.com.cn完全vbindex.html");
|
|
|
+ List<String> domain = getEmails("xjk.jk@qq.com 完全https://www.baidu.com.pro你好http://baidu.com.cn完全vbindex.html");
|
|
|
|
|
|
System.out.println(domain);
|
|
|
|