Email address validation


using System.Text.RegularExpressions;

public static class KWUExtensions {
public static bool IsValidEmailAddress(this string s) {
Regex regex = new Regex(@"^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$");
return regex.IsMatch(s);
}
}

To use it:
string email = "kenny@yahoo.ca";
bool result = email.IsValidEmailAddress();
Console.WriteLine("{0} is : {1}", email, result);