Skip to content

Instantly share code, notes, and snippets.

@johanlindfors
Created October 20, 2012 07:22
Show Gist options
  • Save johanlindfors/3922503 to your computer and use it in GitHub Desktop.
Save johanlindfors/3922503 to your computer and use it in GitHub Desktop.
Validate email in C#
public static bool ValidateEmail(string email)
{
Regex regex = new Regex(@"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$");
Match match = regex.Match(email);
return match.Success;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment