Skip to content

Commit

Permalink
Fix regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Xi-Plus committed Mar 15, 2024
1 parent c8bacce commit d5b016e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ function parseMailBody(text) {
...text.matchAll(/(?:(?:[][]|[]|使[])(?:[]?)?)[]?[:]?\s*"(?:User:)?([^#]*?)"/g),
...text.matchAll(/(?:(?:[][]|[]|使[])(?:[]?)?)[]?[:]?\s*(?:User:)?([^#]*?)/g),
...text.matchAll(/(?:(?:[][]|[]|使[])(?:[]?)?)[]?[:]?\s*(?:User:)?([^#]*?)/g),
...text.matchAll(/(?:(?:[][]|[]|使[])(?:[]?)?)[]?[:]?\s*[\[]\s*(?:User:)?([^#]*?)\s*[\]]/g),
...text.matchAll(/(?:(?:[][]|[]|使[])(?:[]?)?)(?:[:]|[][:])\n?(?:User:)?([^\[\]":,\n#]+)[,.\n]/g),
...text.matchAll(/(?:(?:[][]|[]|使[])(?:[]?)?)[]?[:]?\s*[\[]\s*(?:User:)?([^#]*?)\s*[\]]/g),
...text.matchAll(/(?:(?:[][]|[]|使[])(?:[]?)?)(?:[:]|[][:])\n?(?:User:)?([^\[\]":,\n#]+)[,.\n]/g),
...text.matchAll(/([^#]+?)/g),
...text.matchAll(/([^#]+?)/g),
...text.matchAll(/[][\[](.+?)[\]#][]IP/g),
...text.matchAll(/(?:user ?(?:name|id)|account).{0,20} is\s*:?\s*([^\[\]"#]+?)[.,\n]/ig),
...text.matchAll(/[][\[](.+?)[\]#][]IP/g),
...text.matchAll(/(?:user ?(?:name|id)|account).{0,20} is\s*:?\s*([^\[\]"#]+?)[.,\n]/ig),
...text.matchAll(/(?:user ?(?:name|id)|account).{0,20} is \[([^\[\]#]+?)\]/ig),
...text.matchAll(/(?:user ?(?:name|id)|account).{0,20} is ["]([^\[\]"#]+?)["]/ig),
...text.matchAll(/(?:user ?(?:name|id)|account).{0,20} is ["]([^\[\]"#]+?)["]/ig),
...text.matchAll(/(?:user ?(?:name|id)|account).{0,20}[:] ?([^,.\n#]+?)[.,\n]/ig),
].sort((a, b) => b.index - a.index);
for (var match of matches) {
Expand All @@ -128,7 +128,7 @@ function parseMailBody(text) {
var matches = [
...text.matchAll(/((?:\d{1,3}\.){3}\d{1,3})/g),
...text.matchAll(/((?:[0-9A-Fa-f:]+:+)+(?:[0-9A-Fa-f]+)?)/ig),
...text.matchAll(/(#[1-4]\d{5})/g),
...text.matchAll(/(#[1-5]\d{5})/g),
].sort((a, b) => b.index - a.index);
for (var match of matches) {
// extra test for ipv6
Expand Down

0 comments on commit d5b016e

Please sign in to comment.