Skip to content

Instantly share code, notes, and snippets.

@cameronrye
Last active March 30, 2017 15:16
Show Gist options
  • Save cameronrye/4633a51d93ac50bbada014b64e992b74 to your computer and use it in GitHub Desktop.
Save cameronrye/4633a51d93ac50bbada014b64e992b74 to your computer and use it in GitHub Desktop.
Email is Valid
public static bool EmailIsValid(string email)
{
const string expresion = "\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*";
return IsMatch(email, expresion) && Replace(email, expresion, string.Empty).Length == 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment