Created
October 20, 2012 07:22
-
-
Save johanlindfors/3922503 to your computer and use it in GitHub Desktop.
Validate email in C#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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