So you want to build an email address validator?
Here is some information that can be helpful.
Regular Expressions are powerful however, it is truly the wrong tool for the job.
This is Perl's Regular Expression For Email Validation
So as you can see to get a fully complete email validator is a messy process in Regex and I am assuming that the performance is not that great
For Example, These Are Some of my favorite valid emails
// It is in between quotes and the characters are escaped
"very.(),:;<>[]\".VERY.\"very@\ \"very\".unusual"@strange.example.com
// Yes this is valid.
#!$%&'*+-/=?^_`{}|~@example.org
// Empty Space Between Quotes is allowed
" "@example.org
If you decide to implement an email validator I recommend you read these resources first
Then have a ton of tests. This Repository Contains some JSON files with tests to help you test your email validator.
Feel free to add more tests.
Find a Library to validate you because implementing it yourself is a mess
Feel free to PR more libraries
kenorb for their invalid and valid emails on StackOverFlow.