Community Patterns

Community Library Entry

3

Regular Expression
Created·2015-07-20 21:33
Flavor·ECMAScript (JavaScript)

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

Description

This pattern matches the US Postal Code format and captures the seperate parts; basic and +4.

Submitted by anonymous