IsValidEmailAddress
Check wheter a string is an valid e-mail address
Source
public static class ScottGuExtensions
{
public static bool IsValidEmailAddress(this string s)
{
Regex regex = new Regex(@"^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$");
return regex.IsMatch(s);
}
}
Example
bool f = "test@test.com".IsValidEmailAddress();