Search code examples
regexpostal-code

Anyone got a regex for all known international postcode/zipcodes?


I've been searching for a global postcode based regex but not found one. Anyone know of one that exists?


Solution

  • Not sure if this really makes sense to try to test for, I think it would be: 0-18 characters which can contain: 0-9 + the basic Latin alphabet + spaces, hyphens, parentheses and a Cyrillic letter.

    And I'm not at all sure that even that would cover all possibilities.