go to previous page   go to home page   go to next page

Answer:

([a-zA-Z])([a-zA-Z])([a-zA-Z])[a-zA-Z]*\3\2\1

Several Greedy Quantifiers

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

(a+)(X+).*\1\2

if the greedy group 1 matches only aa and the greedy group 2 matches only XX


QUESTION 15:

Does (a+)(a+)\1\1 match the string aaaaa ?