I’m trying to match a pattern, but I could not fix my REGEX to work well.
I have the text:
REG1QA
And my regex is bellow:
([A-Z]{3})+([1-3]{1})+([A-Z]{1})+((A|B|C)|(D|E|F)|(G|H|I))
The rules is:
If my 4th charactere is 1 my last charactere must be A, B or C
If my 4th charactere is 2 my last charactere must be D, E or F
If my 4th charactere is 3 my last charactere must be G, H or I
How can I fix my REGEX to accept this rule?
tks
Use regex pattern
^.{3}(?:1.*[A-C]|2.*[D-F]|3.*[G-I])$