Here is a Regular Expression to validate the united states 5 and 9 digit zip codes:
^\d{5}(-\d{4})?$
Basic Validations:
• First five letters should be digits.
• It can be followed by a dash and optional 4 digits
Originally posted 2011-04-30 18:18:09.
![Share]()