File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ public static String Phone(String str){
17
17
while (matcher .find ())
18
18
{
19
19
if (matcher .group ().length () == 11 ) {
20
- String is_phone = "^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9 ]|17[6|7| 9]|18[0-9])\\ d{8}$" ;
20
+ String is_phone = "^(13[0-9]|14[5|7]|15[^4 ]|17[6- 9]|18[0-9])\\ d{8}$" ;
21
21
Matcher matcher2 = Pattern .compile (is_phone ).matcher (matcher .group ());
22
22
while (matcher2 .find ()) {
23
23
phones .add (matcher2 .group ());
@@ -90,7 +90,8 @@ public static boolean in_ip(String str){
90
90
//邮箱匹配
91
91
public static String Email (String str ){
92
92
ArrayList <String > email = new ArrayList <>();
93
- String is_email = "[\\ w-]+(?:\\ .[\\ w-]+)*@(?:[\\ w](?:[\\ w-]*[\\ w])?\\ .)+[A-Za-z]{2,6}" ;
93
+ // 增加png|jpg等排除
94
+ String is_email = "[\\ w-]+(?:\\ .[\\ w-]+)*@(?:[\\ w](?:[\\ w-]*[\\ w])?\\ .)+(?:((?!png))((?!jpg))((?!jpeg))((?!gif))((?!ico))((?!html))((?!js))((?!css)))[A-Za-z]{2,6}" ;
94
95
Matcher matcher = Pattern .compile (is_email ).matcher (str );
95
96
while (matcher .find ()){
96
97
email .add (matcher .group ());
@@ -128,7 +129,7 @@ public static boolean js (String headers,byte[] content){
128
129
}
129
130
// 去重代码
130
131
public static List <String > removeDuplicate (ArrayList <String > strings ){
131
- List <String > list2 = new ArrayList (strings );
132
+ List <String > list2 = new ArrayList < String > (strings );
132
133
list2 = list2 .stream ().distinct ().collect (Collectors .toList ());
133
134
return list2 ;
134
135
}
You can’t perform that action at this time.
0 commit comments