A regular expression to match and valid US.S five-digit and nine-digit (zip+4) postal codes.
4 Digits Regex:
/^\d{5}(?:[-\s]\d{4})?$/
Matches:
- 12345
- 12345-6789
- 12345 6789
See Also:
- US Phone Number Regular Expression
- Regular Expression To Match US/UK/CA Zip (Postal) Codes
- US EIN (Employer Identification Number) Regular Expression