I need to validate a email address the best way, and I need to include some danish characters:
Æ Ø Å
æ ø å
My current regex is:
\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
How to incorporate the extra letters, and is there any optimizing that can be done to ensure the best handling of the e-mail address?
Email address validation is hard with regular expressions.
A simple version could be:
but this will fail on some valid addresses like
Tim\ O'Reilly@microsoft.comorme@1.2.3.4, and match lots of invalid addresses likehere@there.where.In any way, you have to send an e-mail to it and get a response before you really know whether an address is valid or not.