Regular Expressions 101

Community Patterns

us postal/zip

14

Regular Expression
ECMAScript (JavaScript)

/
(^[0-9]{4}?[0-9]$|^[0-9]{4}?[0-9]-[0-9]{4}$)
/
gm

Description

Loading markdown...
Submitted by jay johnson - 10 years ago