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

Please support RegExLib Sponsors

Sponsors

Advanced Search

Keywords

Category

Minimum Rating

Results per Page

Search Results: 20 regular expressions found.

   Displaying page 1 of 1 pages; Items 1 to 20
Title Test Details Pattern Title
Expression
^\d{5}-\d{4}|\d{5}|[A-Z]\d[A-Z] \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 | G3H 6A3
Non-Matches
Ohio | abc | g3h6a3
Author Rating: The rating for this expression. Steven Smith
Title Test Details 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: The rating for this expression. Qing Jiang
Title Test Details Pattern Title
Expression
^([A-Za-z]\d[A-Za-z][-]?\d[A-Za-z]\d)
Description
Regular expression to match a canadian postal code where it matches a string with or without the hyphen and in upercase or lowercase
Matches
a1a-1a1 | A1A1A1
Non-Matches
1a1-a1a | aaa-aaa | 111-111
Author Rating: The rating for this expression. Rico lour
Title Test Details Pattern Title
Expression
^((\d{5}-\d{4})|(\d{5})|([AaBbCcEeGgHhJjKkLlMmNnPpRrSsTtVvXxYy]\d[A-Za-z]\s?\d[A-Za-z]\d))$
Description
Regular expression for US (ZIP and ZIP+4) and Canadian postal codes. It allows 5 digits for the first US postal code and requires that the +4, if it exists, is four digits long. Canadain postal codes can contain a space and take form of A1A 1A1. The letters can be upper or lower case, but the first letter must be one of the standard Canadian zones: A,B,C,E,G,H,J,K,L,M,N,P,R,S,T,V,X,Y.
Matches
00501 | 84118-3423 | n3a 3B7
Non-Matches
501-342 | 123324 | Q4B 5C5
Author Rating: The rating for this expression. Matthew Aznoe
Title Test Details Pattern Title
Expression
^[abceghjklmnprstvxyABCEGHJKLMNPRSTVXY][0-9][abceghjklmnprstvwxyzABCEGHJKLMNPRSTVWXYZ] {0,1}[0-9][abceghjklmnprstvwxyzABCEGHJKLMNPRSTVWXYZ][0-9]$
Description
Canadian Postal Code / Codes / Canada / Zip Google for DFIOQU and you'll see where I got the info for this. Can anyone simplify this?
Matches
G3M 5T9 | C3M5T9
Non-Matches
Z3M 5T9 | W3M 5T9 | 5T9 C3M
Author Rating: Not yet rated. W. D.
Title Test Details Canadian postal code format verification
Expression
([ABCEGHJKLMNPRSTVXY][0-9][ABCEGHJKLMNPRSTVWXYZ])\ ?([0-9][ABCEGHJKLMNPRSTVWXYZ][0-9])
Description
Accurate Canadian postal code format verification. The format of a Canadian postal code is LDL DLD where L are alpha characters and D are numeric digits. But there are some exceptions. The letters D, F, I, O, Q and U never appear in a postal code because of their visual similarity to 0, E, 1, 0, 0, and V respectively. In addition to avoiding the six "forbidden" letters W and Z also do not appear as the first letter of a postal code (at least not at present).
Matches
M1R 4B0 | L0R 1B1 | L0R1B9
Non-Matches
W1R 4B0 | L0R 1D1 | LOR1B9
Author Rating: The rating for this expression. Vassilis Petroulias
Title Test Details Canadian Postal Code
Expression
\b[A-Z-[DFIOQUWZ]]\d[A-Z-[DFIOQU]]\ +\d[A-Z-[DFIOQU]]\d\b
Description
Find out Canadian Postal Code in the text or html file or xml file
Matches
L4X 1S9
Non-Matches
12345
Author Rating: Not yet rated. Balram Watwani
Title Test Details Canadian postal code
Expression
\b(?([A-Z])[^DFIOQUWZ])\d(?([A-Z])[^DFIOQU])\d(?([A-Z])[^DFIOQUWZ])\d\b
Description
Matches Canadian postal codes from http://en.wikipedia.org/wiki/Canadian_postal_code. Originally I was going to use http://regexlib.com/REDetails.aspx?regexp_id=1676 but C# did not like it. I rewrote it to this version which works correctly.
Matches
K7P3K6
Non-Matches
W7P3K6
Author Rating: Not yet rated. Matthew Hartman
Title Test Details US zip & Canadian postal codes
Expression
^ *([AaBbCcEeGgHhJjKkLlMmNnPpRrSsTtVvXxYy]\d[a-zA-Z]) *-* *(\d[a-zA-Z]\d) *$|^ *(\d{5}) *$|^ *(\d{5}) *-* *(\d{4}) *$
Description
Matches all valid US standard, US +4, and Canadian postal codes. Returns results for only either one of them, in groups, regardless of case or whitespace (even dashes).
Matches
"H4H 3p4" "90210" "10110-4422" "v4p-5J3"
Non-Matches
"D2T1R3" "92221-133" "xv3r p1T"
Author Rating: Not yet rated. paul
Title Test Details Canada postal code
Expression
^[ABCEGHJKLMNPRSTVXYabceghjklmnprstvxy]{1}\d{1}[A-Za-z]{1}\d{1}[A-Za-z]{1}\d{1}$
Description
Matches the Canadian postal code with no space between.
Matches
M4S1G9 | m6p1l1 | m4s1G9
Non-Matches
M4S 1G9 | m6p 1l1 | m4s 1G9
Author Rating: The rating for this expression. Nassim Ghods
Title Test Details Canadian Postal Code
Expression
^[ABCEGHJKLMNPRSTVXYabceghjklmnprstvxy]{1}\d{1}[A-Za-z]{1}[ ]{0,1}\d{1}[A-Za-z]{1}\d{1}$
Description
Matches the Canadian postal code with or without space between. Also matches uppercase and lower case letters.
Matches
K4A3Z5 | K4A 3Z5 | k4a3z5 | k4a 3z5
Non-Matches
D1G 1T9 | abc def | 123 456 | f1g4t0
Author Rating: The rating for this expression. Sheir Ali
Title Test Details Canadian Postal Code
Expression
^([a-z-[dfioquwz]]|[A-Z-[DFIOQUWZ]])\d([a-z-[dfioqu]]|[A-Z-[DFIOQU]])(\s)?\d([a-z-[dfioqu]]|[A-Z-[DFIOQU]])\d$
Description
Take in account the fact that the first letter cannot be a w or a z moreover the fact that letters cannot be any of DFIOQU
Matches
J0H 1A0
Non-Matches
W4C 8S9
Author Rating: Not yet rated. Michel Verrier
Title Test Details Canada Postal Codes
Expression
^(?<full>(?<part1>[ABCEGHJKLMNPRSTVXY]{1}\d{1}[A-Z]{1})(?:[ ](?=\d))?(?<part2>\d{1}[A-Z]{1}\d{1}))$
Description
This is a combination of Jerry Schmersahl's (http://regexlib.com/REDetails.aspx?regexp_id=930) US ZIP Code regex and John Alpha's (http://regexlib.com/REDetails.aspx?regexp_id=2754) Canadian Postal Code regex. It takes a Canadian postal code with or without a space and matches the first three digits to the named reference 'part1', the second three digits to the named reference 'part2', and the entire code (if a match) to the named reference 'full'
Matches
M4S 1G9 | M4S1G9 | K1A0B1 | K1A 0B1
Non-Matches
123 ABC | 5A2A2B | K1A 0B | M4S | 90210
Author Rating: The rating for this expression. Christopher Congdon
Title Test Details Canadian Postal Code
Expression
^(?![DFIOQU])([ABCEGHJ-NPRSTVXY]\d[A-Z][ ]\d[A-Z]\d)$
Description
Validates Canadian postal codes. Format: A9A 9A9 Cannot contain: DFIOQU First letter must be one of: ABCEGHJKLMNPRSTVXY
Matches
A9A 9A9 | T3P 6N1
Non-Matches
D9U 1O5
Author Rating: Not yet rated. Brad Williams
Title Test Details Canadian Postal Code
Expression
^[ABCEGHJKLMNPRSTVXY][0-9][A-Z]\s?[0-9][A-Z][0-9]$
Description
Complies with the Canadian Postal Code requirements as described at http://www.infinitegravity.ca/postalcodeformat.htm Allows for optional center space.
Matches
J0E 1S0, X0E 1W0, N0G1L0
Non-Matches
I0W 2X9, 123456
Author Rating: Not yet rated. Doug Vanderweide
Title Test Details US & CAN Postal Codes
Expression
^((\d{5})|(\d{5}-\d{4})|([A-CEGHJ-NPR-TV-Z]\d[A-CEGHJ-NPR-TV-Z]\s\d[A-CEGHJ-NPR-TV-Z]\d))$
Description
Matches U.S. and Canadian postal codes that follow the proper numbering schemes.
Matches
01234,01234-1234,1A1-A1A
Non-Matches
123456,12345-12345,1D1-D1D
Author Rating: Not yet rated. Nathon Dalton
Title Test Details Canadian Postal Code
Expression
^[a-zA-Z]{1}[0-9]{1}[a-zA-Z]{1}[- ]{0,1}[0-9]{1}[a-zA-Z]{1}[0-9]{1}
Description
Matches Canadian style postal codes
Matches
v0h-1t0 | V0H1T0 | V0h 1t0
Non-Matches
V0H--1T0 | V0H11T0 | V0H.1T0
Author Rating: Not yet rated. Kyle
Title Test Details U.S. and Canadian postal codes
Expression
^((\d{5}-?\d{4})|(\d{5})|([A-Za-z]\d[A-Za-z]\s?\d[A-Za-z]\d))$
Description
This expression more loosely 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 (optional), and then 4 numeric digits. The Canadian postal code must be of the form ANANAN where A is any alphabetic character (case insensitive) and N is a numeric digit from 0 to 9. A space between the 2nd "A" and 2nd "N" is optional but not required, so the form could also be interpreted as "ANA NAN"
Matches
90210, 90210-1234, 902101234, H0H0H0, h0h0h0, H0H 0H0, h0h 0h0
Non-Matches
9021090210, California, ABC123, ABC 123, H0H H0H
Author Rating: Not yet rated. Douglas Barbin
Title Test Details Canadian Postal Code
Expression
^[A-Za-z]\d[A-Za-z][ -]?\d[A-Za-z]\d$
Description
Validates the canadian postal code in A1A-1A1
Matches
Z1Z 1Z1 AND Z1Z-1Z1 AND Z1Z1Z1
Non-Matches
apart from above formats
Author Rating: Not yet rated. Rajesh
Title Test Details Canada Postal Code
Expression
^(?![DFIOQUWZ])[A-Z]{1}[0-9]{1}(?![DFIOQU])[A-Z]{1}[ ]{1}[0-9]{1}(?![DFIOQU])[A-Z]{1}[0-9]{1}$
Description
Matches a string against valid Canadian postal codes
Matches
T2Z 4Z7 | L8V 2J5
Non-Matches
A2D 1FZ | D1E 8F0
Author Rating: The rating for this expression. Jason Gradwell
   Displaying page 1 of 1 pages; Items 1 to 20

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