Community Patterns

Community Library Entry

0

Regular Expression
Created·2019-01-23 16:36
Flavor·PCRE (Legacy)

/
^(?!0{3})\d{5}(?:-?\d{4})?$
/
gm
Open regex in editor

Description

This Regex is for US Zip Code like 5 digits (12345), or like 9 digits with no spaces (123456789), or like 10 digits with a hyphen if it has the 9 numbers (12345-6789) and also Starting 3 continuous characters MUST NOT zeros(0).

Submitted by anonymous