Skip to content

Commit

Permalink
Merge pull request #198 from Francismori7/master
Browse files Browse the repository at this point in the history
Add Canadian Postal Code support
  • Loading branch information
nghuuphuoc committed Apr 21, 2014
2 parents 35c9ba5 + 93fa5a3 commit 62caca6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/js/validator/zipCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

options.country = options.country || 'US';
switch (options.country.toUpperCase()) {
case 'CA':
return /(?:A|B|C|E|G|J|K|L|M|N|P|R|S|T|V|X|Y){1}[0-9]{1}(?:A|B|C|E|G|J|K|L|M|N|P|R|S|T|V|X|Y){1}\s?[0-9]{1}(?:A|B|C|E|G|J|K|L|M|N|P|R|S|T|V|X|Y){1}[0-9]{1}/i.test(value);
case 'DK':
return /^(DK(-|\s)?)?\d{4}$/i.test(value);
case 'SE':
Expand Down

0 comments on commit 62caca6

Please sign in to comment.