Postal codes (aka ZIP codes) in the United States consist of 5 digits with an optional 4 digit suffix.
Variation | Pattern | |
---|---|---|
US Zip Code (standalone) | ^((\d{5})(-\d{4})?)$ | |
US Zip Code (inline) | \b((\d{5})(-\d{4})?)\b |
{ "detail": "Postal codes (aka ZIP codes) in the United States consist of 5 digits with an optional 4 digit suffix.\n\n[Wikipedia](https://en.wikipedia.org/wiki/ZIP_Code)\n", "featured": true, "handle": "zip-code", "title": "Zip (aka Postal) Codes in the United States", "tags": [ "postal-code", "united-states", "us" ], "variations": [ { "title": "US Zip Code (standalone)", "pattern": "^((\\d{5})(-\\d{4})?)$" }, { "title": "US Zip Code (inline)", "pattern": "\\b((\\d{5})(-\\d{4})?)\\b" } ], "fullPath": "/app/patterns/zip-code.yaml" }