Validate Canadian Postal Code Regex

后端 未结 7 2276
[愿得一人]
[愿得一人] 2021-02-20 07:12

I have a script written in JavaScript to Validate Canadian Postal Codes using Regex, however it does not seem to be working. Here is the script:

If statement:

         


        
7条回答
  •  鱼传尺愫
    2021-02-20 07:40

    this will work for all canadian postal codes..

    ^[ABCEGHJKLMNPRSTVXY]{1}\d{1}[A-Z]{1} *\d{1}[A-Z]{1}\d{1}$
    

提交回复
热议问题