Skip to content

Instantly share code, notes, and snippets.

@lukehedger
Created August 13, 2014 15:11
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 lukehedger/a1c684ee6927f40f5107 to your computer and use it in GitHub Desktop.
Save lukehedger/a1c684ee6927f40f5107 to your computer and use it in GitHub Desktop.
UK Postcode RegExp

Official Gov UK postcode regular expression:

^([Gg][Ii][Rr] 0[Aa]{2})|((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([AZa-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9]?[A-Za-z])))) [0-9][A-Za-z]{2})$

@lukehedger
Copy link
Author

Resource:

GovUK - see section 3

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