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
1 changed files with 2 additions and 2 deletions

View File

@ -39,8 +39,8 @@ class ExtractEmailAddresses extends Operation {
*/
run(input, args) {
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);
}