Please help me compose a working regular expression. Conditions:
- There can be a maximum of
9characters (from 1 to 9). - The first eight characters can only be uppercase letters.
- The last character can only be a digit.
Examples:
Do not match:
S3FT5FGTU7ERTYUOP9ERTGHYUKM
Correspond to:
EERTRTYUKLVBNDEFRW3
I tried using the following:
^[A-Z]{1,8}\d{0,1}$
but in this case, the FT5 example matches, although it shouldn't.