I found the following email validation code in the newsgroup and it works great except it won't allow a dash in the name. I do not understand regular expressions so I'm unsure of how to fix it.
Can someone who understands regular expressions tell me what needs to be changed to allow a dash in the email name
public static bool IsValidEmailAddress(string sEmail
if (sEmail == null
return false
els
return Regex.IsMatch(sEmail, @
[-a-zA-Z0-9][-.a-zA-Z0-9]
[-.a-zA-Z0-9]
(\.[-.a-zA-Z0-9]+)
\
com|edu|info|gov|int|mil|net|org|biz
name|museum|coop|aero|pr
[a-zA-Z]{2
$",
RegexOptions.IgnorePatternWhitespace)
}