Title |
Test
Find
Pattern Title
|
Expression |
^\d{5}((-|\s)?\d{4})?$ |
Description |
Single field zip code validator, useful for Web Forms. Allows user to enter 5-digit or 5-digit plus 4 zip code, with hyphen or space or NO space between last 4 digits. |
Matches |
92078-4705 | 920784705 | 92078 4705 |
Non-Matches |
9027x | 902 | 92078.4705 |
Author |
Rating:
MARK J KRISBURG
|
Source |
Modification of Ryan Van Aken's code |
Your Rating |
|
Title: Gud Work
Name: Nilesh
Date: 10/24/2005 12:10:25 PM
Comment:
Balle Balle
Title: Zip Code
Name: Mark Krisburg
Date: 11/14/2004 12:16:59 AM
Comment:
Web form users are unpredictable whether they will enter 5 or 9 digit zip codes, and whether they will use a hyphen or space or nothing between the first 5 digits and last 4 digits.