Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email search regex does not include + #365

Closed
WalterMccan opened this issue Sep 14, 2018 · 0 comments · Fixed by #373
Closed

Email search regex does not include + #365

WalterMccan opened this issue Sep 14, 2018 · 0 comments · Fixed by #373

Comments

@WalterMccan
Copy link

regex = /\b\w[-.\w]*@[-\w]+(?:\.[-\w]+)*\.[A-Z]{2,4}\b/ig;

Some email providers accept emails with '+' eg. example+name@example.com . In such situation, email is sent to example@example.com and allocated to a specific folder, automated reply etc..

The current regex would only match name@example.com which is not the actual email of the recipient.
It is a rare occurrence but I thought I would throw it in for the good measure.

Alternative regex could be

\b\w[-+.\w]*@[-\w]+(?:\.[-\w]+)*\.[A-Z]{2,4}\b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants