1
0
mirror of synced 2024-11-16 03:03:22 +01:00

update regex to match more email address variations

This commit is contained in:
Klaxon 2018-10-02 13:40:47 +10:00
parent ec9dfd2918
commit 62b76777c0

View File

@ -39,8 +39,8 @@ class ExtractEmailAddresses extends Operation {
*/ */
run(input, args) { run(input, args) {
const displayTotal = args[0], const displayTotal = args[0],
regex = /\b\w[-.\w]*@[-\w]+(?:\.[-\w]+)*\.[A-Z]{2,4}\b/ig; // email regex from: https://www.regular-expressions.info/email.html
regex = /\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/ig;
return search(input, regex, null, displayTotal); return search(input, regex, null, displayTotal);
} }