Put simply: “YOU DON’T” so quit trying.

Just today:

Why people insist on attempting this is beyond me. I’ve grown to really like Regex, I’ve even built a light-weight xml parser on regular expressions but you can not parse email addresses with a regex. Just look at some of these crazy attempts in the daily wtf comments.

If you want to validate an email use:

{ new System.Net.Mail.MailAddress(email); return true; }
{ return false; }

If you MUST use a regular expression on the client for email validation, try this one:


More Info:

3.4.1. Addr-spec specification

An addr-spec is a specific Internet identifier that contains a locally interpreted string followed by the at-sign character (“@”, ASCII value 64) followed by an Internet domain.

Yes, locally interpreted, meaning you can’t. Yes the RFC does state some constraints, but they are too complex to express in a regex. Get a library or don’t validate it.