I've come across a description of a decent email regex.
/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
But I would also like to include some punctuation characters into the first part of the email whilst retaining the rest of the functionality (such as no repeated .)
The best I have come up with so far is:
([\/!#$%&'*+-=?^_`{|}~]*\w+)([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,40})+$
But this will not allow punctuation at the end of the first part of the email.
I find regex so confusing, does anyone know how to properly implement this?
Example:
Yes [email protected]
Yes [email protected]
Yes [email protected]
Yes [email protected]
Yes [email protected]
Yes email@[123.123.123.123]
Yes "email"@domain.com
Yes [email protected]
Yes [email protected]
Yes [email protected]
Yes [email protected]
Yes [email protected]
Yes [email protected]
No plainaddress
No #@%^%#$@#$@#.com
No @domain.com
No Joe Smith <[email protected]>
No email@[email protected]
No [email protected]
No [email protected]
No [email protected]
No あいうえお@domain.com
No [email protected] (Joe Smith)
No email@domain
No [email protected]
No [email protected]