Regular Expression to validate the US zip codes

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