It's actually theoretically impossible to fully validate an email address using just a regular expression.
Check out my blog post about it for a discussion on the subject and a F# implementation using FParsec.
[/shameless_plug] Here's my answer -- Phil's solution fails for single letter domains like "[email protected]".
Believe it or not, that's used =) (goes to centurylink, for instance).
This is an old question, but all the answers I've found on SO, including more recent ones, are answered similarly to this one. Net 4.5 / MVC 4 you can add email address validation to a form by adding the [Email Address] annotation from System. Data Annotations, so I was wondering why I couldn't just use the built-in functionality from . This seems to work, and seems to me to be fairly elegant: @hofnarwillie: it is in the main body, but the comments elaborate.
If your goal is to not anger your users then your validation shouldn't be any more restrictive than the spec.
What's wrong with bobby table's email address if you're using prepared statements.