Skip to content

Instantly share code, notes, and snippets.

@mattvague
Created September 21, 2011 21:55
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 mattvague/1233433 to your computer and use it in GitHub Desktop.
Save mattvague/1233433 to your computer and use it in GitHub Desktop.
Regex that matches any valid zip code or postal code
/(^\d{5}$)|(^\d{5}-\d{4}$)|(^[a-zA-Z]\d[a-zA-Z] ?\d[a-zA-Z]\d$)/i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment