Skip to content

Instantly share code, notes, and snippets.

@stephan281094
Last active August 29, 2015 14:15
Show Gist options
  • Save stephan281094/2fa4bf97c20b77fe9648 to your computer and use it in GitHub Desktop.
Save stephan281094/2fa4bf97c20b77fe9648 to your computer and use it in GitHub Desktop.
Zipcode regex
/^([A-PR-UWYZ0-9][A-HK-Y0-9][AEHMNPRTVXY0-9]?[ABEHMNPRVWXY0-9]? {1,2}[0-9][ABD-HJLN-UW-Z]{2}|GIR 0AA|[0-9]{4,5}|[0-9]{4}[ ]?[a-zA-Z]{2})$/
@stephan281094
Copy link
Author

This regex works for the following countries:

  • The Netherlands
  • Spain
  • Switzerland
  • France
  • Belgium
  • Italy
  • Portugal
  • Germany
  • Austria
  • United Kingdom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment