How to Match Zip Codes with Wildcards

We provide 4 wildcards to match zip codes, which are:

  • *: Match any number of characters
  • ?: Match a single character, e.g. 1?10 matches 1010, 1110, 1a10, etc.
  • ^: Starting character, used to identify the starting character, e.g. ^10 matches 10, 101, 1006, etc.
  • $: Terminator, used to identify the ending character, e.g. 51$ matches 51, 1051, 151, etc.

If we want to match a 4-digit zip code that starts with 12, then we can write the following value:

^12??$

Match Zip Codes

Was this article helpful?
Updated on October 13, 2025
Can't find what you're looking for?
Send us an email