([a-zA-Z])([a-zA-Z])([a-zA-Z])[a-zA-Z]*\3\2\1
Regular Expression | |||
String | |||
Group 0 | |||
Group 1 | Group 2 | Group 3 | Group 4 |
If there are several greedy quantifiers in an expression, each tries to match as much as it can, but the quantifiers cooperate so that the entire expression matches, if possible. For example
(a+)(X+).*\1\2
matchs a substring of aaaaXXXXaaXX
if the greedy group 1 matches only aa and the greedy group 2 matches only XX
Does (a+)(a+)\1\1
match the string aaaaa ?