hey, im trying to create a regular expression for canadian postal codes
i want to validate either one of these expressions
l7p3r3
l7p 3r3
l7p-3r3
L7P3R3
L7P 3R3
L7P-3R3
right now i have this as my expression
[a-zA-Z][0-9][a-zA-Z][-|\s|\S][0-9][a-zA-Z][0-9]
however there is a problem, and it seems to be where the 4th character is("[-|\s|\S]").where it can be either a dash("-") or a space(" ") or no space("")
if someone could please help out with the correct expression for this expression would be great.
thanks
i want to validate either one of these expressions
l7p3r3
l7p 3r3
l7p-3r3
L7P3R3
L7P 3R3
L7P-3R3
right now i have this as my expression
[a-zA-Z][0-9][a-zA-Z][-|\s|\S][0-9][a-zA-Z][0-9]
however there is a problem, and it seems to be where the 4th character is("[-|\s|\S]").where it can be either a dash("-") or a space(" ") or no space("")
if someone could please help out with the correct expression for this expression would be great.
thanks