Regex · US ZIP code · Free
US ZIP code regex.
Matches a 5-digit US ZIP code with an optional +4 extension. Copy the pattern below, see what it matches, then tweak it for your exact case with the free generator.
The pattern
/\b\d{5}(?:-\d{4})?\b/g
✓ Matches
9410510001-234560601✗ Doesn't match
9410ABCDE123456Need a variation? Generate one
Other common patterns
Parsing and pattern-matching are everywhere in AI systems. MindloomHQ teaches you to build them for real — agents, RAG, pipelines — with projects and certificates.
Explore MindloomHQ →