Title |
Test
Find
Pattern Title
|
Expression |
^((\d{5}-\d{4})|(\d{5})|([A-Z]\d[A-Z]\s\d[A-Z]\d))$ |
Description |
This expression matches three different formats of postal codes: 5 digit US ZIP code, 5 digit US ZIP code + 4, and 6 digit alphanumeric Canadian Postal Code. The first one must be 5 numeric digits. The ZIP+4 must be 5 numeric digits, a hyphen, and then 4 numeric digits. The Canadian postal code must be of the form ANA NAN where A is any uppercase alphabetic character and N is a numeric digit from 0 to 9. |
Matches |
44240 | 44240-5555 | T2P 3C7 |
Non-Matches |
44240ddd | t44240-55 | t2p3c7 |
Author |
Rating:
Qing Jiang
|
Source |
|
Your Rating |
|
Title: thank you
Name: Dave Cook
Date: 2/19/2024 8:16:30 PM
Comment:
Thank you very much
Title: me
Name: me
Date: 2/9/2004 3:37:46 PM
Comment:
works great! Thanks Qing