Hi there People,
As you all know, I'm useless at regex; though I am attempting to learn it, but it still eludes me..
I have an inputbox which the user is restricted to chars that they can enter, BUT I would like to determine that they enter the string in the correct order.
Example:-
(this is the format that I expect the user to submit)
DR/NA025/02
As you can see this could be entered in many different permutations, so I am wondering if there would be a regex way of handling this phrase - IE: only being able to submit this string in this format.
So in laymans: 2 aplha chars single / 2 alpha chars + 3 digits single / + 2 digits
This is what I have managed up to yet:
^[DR]/[NA][\d{3}]/[\d{2}]$ I'm sure as it's wrong, but I can't fathom it out...
Any thoughts/ideas/suggestions appreciated.
Cheers,
MRb
[edited by: Matthew1980 at 9:55 pm (utc) on Jan 24, 2012]