Canadian post code format

More
12 years 2 months ago #3071 by Daniel
Hi,

According to the Canadian Zipcode you must exclude the letters D, F, I, O, Q, & U in the 2nd & 3rd letters. Since insensitivity can be expressed with /i the below \"blocks\"
should work:
As shown:
^((\\d{5}-\\d{4})|(\\d{5})|([AaBbCcEeGgHhJjKkLlMmNnPpRrSsTtVvXxYy]\\d[A-Za-z]\\s?\\d[A-Za-z]\\d))$
Suggested replacement for Alpha blocks:
[ABCEGHJKLMNPRSTVXY]
[ABCEGHJKLMNPRSTVWXYZ]
[ABCEGHJKLMNPRSTVWXYZ]
If I am wrong, you should fix the CA zipcode.

Daniel

Please Log in or Create an account to join the conversation.

More
12 years 2 months ago #3072 by admin
Replied by admin on topic Re: Canadian post code format
Daniel

To be honest we are not the best experts when it comes to regular expression.
It is not a problem to change expression.

The question is: are you 100 percent sure that the one you suggested is the correct one?

Mike

Mike
ETL Architect

Please Log in or Create an account to join the conversation.