View Full Version : javascript regular Expressions

05-12-2009, 07:20 AM

I have one problem that is i need the canada postal code validations using regular expressions the postal code is of 7digits including white space a0E T5R means it is combination of digits and alphabets and a space after 3 digits.using javascript
please help me to getride from this problem.
Thanks & Regards

05-12-2009, 08:54 AM
Not positive but try validating against this


I've tested this but it fails against your example.

My investigations show that Canadian postcodes are formatted a9A 9A9, this code works against that.

I have also not allowed 'w' or 'z' as the first letter because they are not used yet