Regex Cheatsheet - Regular Expression Quick Reference

Quick reference for regular expression patterns. Character classes, quantifiers, anchors, and common patterns.

Share
Back to Regex Cheatsheet

Postal/ZIP Code Pattern

Common Pattern

Match US ZIP code (5 digits or ZIP+4 format)

Pattern

^\d{5}(-\d{4})?$

Examples

10001

5-digit ZIP

Matches: 10001

12345-6789

ZIP+4 format

Matches: 12345-6789

Related Tools

More Text Tools