Validating e-Mails: You’re Doing It Wrong

Phil Haack has a great article about validating e-mails. Things always seem to get interesting when you actually RTFM (or in this case, RFC). I Knew How To Validate An Email Address Until I Read The RFC.

Having my mind eroded by past years of Perl hacking, the regular expression made me smile:

string pattern = @"^(?!\.)(""([^""\r\\]|\\[""\r\\])*""|" 
    + @"([-a-z0-9!#$%&'*+/=?^_`{|}~]|(?

Thanks for the research and article, Phil. I'll not look at e-mail validation the same.

Leave a Reply