I'm pretty new to regular expressions and am not sure where to start. Using eregi() so that it is case insensitive I want to be able to verify a string has the following:
- number 0-9 and optional 0-9 and a one digit letter (t,d,w,m)
- Or the reverse of this
Some samples of legitimate strings:
t03
3t
05w
w05
The following would not be legit:
3t4
a14
113t
So the only legitimate 1 character letters are t, d, w, and m and the numbers can be 1 or 2 characters.
Thank you so much for your help!
This is what I have but it doesn't seem to be working:
eregi("[0-9][0-9]?(t|d|w|m)$ | (t|d|w|m)[0-9][0-9]?$", $str, $out);