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:
This is a valid expression for a Canadian Postal Code that I use. It will format strictly as A0A 0A0.
/^[A-Za-z]\d[A-Za-z][ -]?\d[A-Za-z]\d$/