View: validate email

  1. 4 months ago by sx
    1. /*method validateMail*/
    2.         public bool validateMail(string Mailadress)
    3.         {
    4.             string mailPattern = @"^[\w\._]{1,}@[\w\._]{2,}\.\w{2,4}$”;
    5.             Regex re = new Regex(mailPattern);
    6.             Match ma = re.Match(Mailadress);
    7.             if (ma.Success)
    8.                 return true;
    9.             else
    10.                 return false;
    11.         }

0 comment about "validate email"