var regex = /[A-Za-z]\\d[A-Za-z] ?\\d[A-Za-z]\\d/; var match = regex.exec(value); if (match){ if ( (value.indexOf(\"-\") !== -1 || value.indexOf(\" \") !== -1 )
User kind, postal code strict, most efficient format:
/^[ABCEGHJ-NPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][ -]?\d[ABCEGHJ-NPRSTV-Z]\d$/i
Allows:
Disallows:
Leading Z,W or to contain D, F, I, O, Q or U