I have been trying to find a good RegEx for email validation.
I have already gone through Comparing E-mail Address Validating Regular Expressions and that didn’t suffice all my validation needs.
I have Google/Bing(ed) and scan the top 50 odd results including regular expressions info article and other stuff.
So finally i used the System.Net.Mail.MailAddress class to validate my email address. Since, if this fails, my email won’t get sent to the user.
I want to customize the validation as used by the constructor of the class.
So how do I go ahead and get the validation/RegEx that the MailAddress class is using?
Thanks Reflector… forgot you were still free!
Reflected the System.Net.Mail.MailAddress…
Found that it used a
void ParseValue(string address)and
void GetParts(string address)methods to primary check the mail address format.//Edited
Surprised, no RegEx was involved!