Created
April 15, 2015 16:00
-
-
Save mikeobrien/fd722540cf95e2c92308 to your computer and use it in GitHub Desktop.
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 class EmailAddressValidator | |
{ | |
public const string EmailAddressRegex = "^[^@]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$"; | |
private static readonly Regex Validator = new Regex(EmailAddressRegex); | |
public static bool IsValid(string email) | |
{ | |
return email != null && !email.Contains("\n") && Validator.Match(email).Success; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment