Skip to content

Andy Burns' Blog

Whatever I'm working on

Categories

  • SharePoint
  • Sitecore
  • Software Development
  • Uncategorized
  • Various

Pages

  • About
  • Articles
  • My Favourite Posts

Postcodes

UK Postcode Validation Regex

2018-04-10 Andy BurnsPostcodes3 Comments

So, the Government offer us a regex to validate UK postcodes. According to Wikipedia it should be:

^([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})|(([A-Za-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})$

Nice. That’s not complicated, is it? Continue reading “UK Postcode Validation Regex” →

UK Postcode Validation Regex
Blog at WordPress.com.
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Subscribe Subscribed
    • Andy Burns' Blog
    • Join 30 other subscribers
    • Already have a WordPress.com account? Log in now.
    • Andy Burns' Blog
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar