Regex Library
Regex Library

10 patterns

Location & Address Regex Patterns

Location and address validation patterns for common geographic data formats. Covers postal codes from major countries, GPS coordinates, and country/region codes.

Common Use Cases

Address formsShipping validationGeolocation inputStore locators

Frequently Asked Questions

How do I validate GPS coordinates?

Latitude: ^-?([0-8]?\d|90)(\.\d+)?$ | Longitude: ^-?(\d{1,2}|1[0-7]\d|180)(\.\d+)?$

How do I validate a US ZIP code?

Use ^\d{5}(?:-\d{4})?$ for both 5-digit and ZIP+4 format.

How do I validate a UK postcode?

Use the UK Postcode pattern: ^[A-Z]{1,2}[0-9][0-9A-Z]?\s?[0-9][A-Z]{2}$

Looking for patterns in other categories?

Browse all 209 patterns