My regex (ddX)
should match two digits followed by a specific character ‘X’. Any number of optional characters are allowed to precede it provided it ends with a + character.
For Example:
12X is valid
ABC+22X is valid
ABC+123X is not valid.
I came up with the following regex But this does not work as expected.
(.*+)*(ddX)
.* any number of any characters
+ indicates the character +
(.+) indicates any number of previous occurrence.
(ddX) match two digits followed by X
What am I doing wrong ? I tried various combinations of regex without success.
Multiple variations of the regex.
1