Monday, 22 August 2022

Simple C# code to Validating email address

 public static bool ValidateEmail(string email)
 {
      string regex = @"^[a-z0-9][-a-z0-9._]+@([-a-z0-9]+\.)+[a-z]{2,5}$";
       return Regex.IsMatch(email, regex);
  }

No comments:

Post a Comment