|
-
Oct 22nd, 2009, 01:35 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] RegEx Us/Canada/Mexico Zip Codes
I have been searching the net far and wide...but I am trying to find 1 Regular Expression to validate US, Canada, and Mexico Zip Codes using one validator...does anyone have one or know where i can get one.
Which X do you like better???
Code:
x x \ /
x x \ /
x x \ /
x ><
x x / \
x x / \
x x / \
-
Oct 22nd, 2009, 03:50 PM
#2
Re: RegEx Us/Canada/Mexico Zip Codes
What is the format of zip-codes you want to match?
(I don't stay in any of these countries )
-
Oct 23rd, 2009, 01:40 AM
#3
Re: RegEx Us/Canada/Mexico Zip Codes
Hey,
Have you checked out RegExLib? They have a whole library or regular expressions that you can use!
You can find a link to the website in my signature.
For instance:
US Zip Code:
http://regexlib.com/Search.aspx?k=us...=-1&m=-1&ps=20
Canada Zip Code:
http://regexlib.com/Search.aspx?k=ca...=-1&m=-1&ps=20
Hope that helps!!
Gary
-
Oct 23rd, 2009, 01:56 AM
#4
Re: RegEx Us/Canada/Mexico Zip Codes
The expression for Canadian Postal Codes in the above link is incorrect. The letters D, F, I, O, Q, or U are not used.
-
Oct 23rd, 2009, 03:24 AM
#5
Re: RegEx Us/Canada/Mexico Zip Codes
Hey,
I am sure the Regular Expression can be tweaked to the OP liking, but it would give him somewhere to start.
Gary
-
Oct 23rd, 2009, 07:29 AM
#6
Thread Starter
Hyperactive Member
Re: RegEx Us/Canada/Mexico Zip Codes

This is my issue...i can find one or the other...but i can't find a single expression that will do both...and i am terrible at trying to get them to work (it is not my strong point).
Last edited by rrrctraptor31; Oct 23rd, 2009 at 07:46 AM.
Reason: Spelling issues...lol
Which X do you like better???
Code:
x x \ /
x x \ /
x x \ /
x ><
x x / \
x x / \
x x / \
-
Oct 23rd, 2009, 08:30 AM
#7
Re: RegEx Us/Canada/Mexico Zip Codes
Hey,
Why not just have two regular expressions? They are essentially doing two separate checks, so I don't see why doing two is an issue.
Gary
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|