Hello,
I am trying to validate an input field using Regular
Expression. I have gotten regexp to work great for me in the past,
including things like dates, email addresses and such, but this one
is kicking my butt.
From what I have read, this pattern should work:
[CGNPRST][AELMNUS][1-6]?[A-Z0-9]{2,2}
(4 or 5 characters, with the middle 1-6 optional)
This should match items like:
CL01
CL0F
SS0F
SM20
SMTU
TE11
PA3IT
PACH
And should not match:
PA9IT
PAIT9
I thought the question mark made the previous character
optional (match 0 or 1 time).
If I take the ? out, then I can get PA3IT to work and PA9IT
does not, but neither does PACH or SS0F.
Any suggestions?
Doug Jessee
(At CFUnited 2008 I learned too much, now I have to change
everything.)