Function for Email Validation      1. It allows max 5 dots(.) including .com and max 5 hyphen(-)  2. Only 4 Special Characters allowed are (- _ . @)  3. @ character is allowed only once and is mandatory.      private bool email()   {         string pattern = @"^([a-zA-Z0-9])+([\w_\.\-]([a-zA-Z0-9])*[a-zA-Z0-9])*@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}$)";         System.Text.RegularExpressions.Match match = Regex.Match(textBox1.Text.Trim(), pattern, RegexOptions.IgnoreCase);         if ((match.Success))         {               string[] words = Regex.Split(textBox1.Text.Trim(), "@");               string word1 = words[1].ToString();               int dotCount = word1.Count(f = >  f == '.');        ...