JavaScript RegEx validate US Zip Code & Canada Postal Code

Validate a US Zip Code or Canadian Postal Code in a single combined regular expression.
/(^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ]( )?\d[ABCEGHJKLMNPRSTVWXYZ]\d$)|(^\d{5}(-\d{4})?$)/
Posted by
Snippet Viewed 2388 times.

Share your JavaScript code snippets:

  • Get some recognition & link back to your site.

 

Submit | Browse

Most Recent javascript snippets

Most Viewed