Allow special characters before @ (i.e [email protected]).We are using the following regex:
class Program
{
static bool IsValid(string value)
{
return Regex.IsMatch(value, "^(?(\")(\".+?\"@)|(([0-9a-zA-Z]((\\.(?!\\.))|[-!#\\$%&'\\*\\+/=\\?\\^`\\{\\}\\|~\\w])*)(?<=[0-9a-zA-Z])@))(?(\\[)(\\[(\\d{1,3}\\.){3}\\d{1,3}\\])|(([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+[a-zA-Z]{2,6}))$");
}
static void Main(string[] args)
{
Console.WriteLine(IsValid("[email protected]"));
Console.ReadLine();
}
}