I'm currently having difficulty matching strings with my regex. The objective is to match:
- One or two letters
- One, two or three numbers
- Zero or one asterisk
Such as U21, F305 and H12*. The regex that I'm using is:
\D{1,2}\d{1,3}\*?
However, it's been matching strings like:
- 3.0L
- 6HBW20
- 3/8"
- Y1015
I'm not too bright with regex, but this is holding me from completing my project. Can anyone help me out?
Thank you.