I need regex that validates a string that:
- has 4 or 5 letters
- then one underscore
- then either an I or O (only one of them)
- then one underscore
- then 4 numeric digits
Now here where it complicates further.
After all that it may have:
- another underscore
- then 4 numeric digits.
In the end all these must be valid:
ASDF_I_0002
ASDFG_O_0003_0324
ASDF_O_0001
ASDF_I_0001_0001
Thank you.
has 4 or 5 letters (A-Z)
then one underscore
then either an I or O (only one of them)
then one underscore
then 4 numeric digits
After all that it may have:
another underscore
then 4 numeric digits.
You’ve lined out your requirements so nicely, I wonder where the problem was to make a regex from them. 😉