Regular Expressions 101

Community Patterns

Community Library Entry

2

Regular Expression
Created·2014-02-10 20:36
Flavor·JavaScript

/
(^[0-9]{5}(-[0-9]{4})?$)|(^[ABCEGHJKLMNPRSTVXY]{1}[0-9]{1}[A-Z]{1} *[0-9]{1}[A-Z]{1}[0-9]{1}$)
/
id
Open regex in editor

Description

A zipcode regex for validation of both US and Canada

Submitted by Kyle M.