Skip to content

Instantly share code, notes, and snippets.

@stemount
Created December 15, 2020 12:57
Show Gist options
  • Save stemount/7fce4f60717aa5f1a32e486f8e4a7937 to your computer and use it in GitHub Desktop.
Save stemount/7fce4f60717aa5f1a32e486f8e4a7937 to your computer and use it in GitHub Desktop.
Official Gov.UK Postcode Regex remixed (allowing space e.g. SW1V 2AA)
([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})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment