I need to verify the postal code inserted in a text box and stored in a variable: "$code".
iIf the format is like this: XXXX – XXX
it's valid. If not, it's invalid (the X's are numbers).
Someone told me to make a regex like this one but applied to my needs:
$regex = "/^[ABCEGHJKLMNPRSTVXY]{1}\d{1}[A-Z]{1} *\d{1}[A-Z]{1}\d{1}$/";
Not only do I not know how to make that, but I also don't know what to do after.
Do you guys have any idea on how to solve my problem?