Skip to content

Instantly share code, notes, and snippets.

@tcmorris
Created December 2, 2016 10:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tcmorris/6315bc45acdf348402bbd7969e9b667b to your computer and use it in GitHub Desktop.
Save tcmorris/6315bc45acdf348402bbd7969e9b667b to your computer and use it in GitHub Desktop.
Regex Patterns
public static class RegexPatterns
{
public const string Postcode = "^(GIR 0AA|gir 0aa|[A-PR-UWYZa-pr-uwyz]([0-9]{1,2}|([A-HK-Ya-hk-y][0-9]|[A-HK-Ya-hk-y][0-9]([0-9]|[ABEHMNPRV-Yabehmnprv-y]))|[0-9][A-HJKPS-UWa-hjkps-uw]) {0,1}[0-9][ABD-HJLNP-UW-Zabd-hjlnp-uw-z]{2})$";
public const string EmailAddress = "^[a-zA-Z0-9._%+-]+@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]{2,63}$";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment