RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details US & Canadian Zip Code for Input
Expression
^(\d{5})$|^([a-zA-Z]\d[a-zA-Z]( )?\d[a-zA-Z]\d)$
Description
Created for input validation of major part of zip code. Normal Canadian entry has an optional space between the first group of three and the second group. Original pattern taken from Steven Smith and modified for our entries.
Matches
12345|A6A 6A6|A6A6A6
Non-Matches
aaaaa|6A6A6A
Author Rating: Not yet rated. Jeff Finley
   Displaying page 1 of 1 pages; Items 1 to 1

Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials