go to previous page   go to home page   go to next page
[a-z])+([0-9]+)([a-z]+

Answer:

No.. the parentheses are not balanced.


Nested Groups

Regular Expression
String
Group 0
Group 1 Group 2 Group 3 Group 4

Capture groups may be nested. A group consists of a left parenthesis and whatever is included up to its matching right parenthesis. This means that the characters that are captured by one group may also belong to another group.

([a-z]+)([0-9]+)([a-z]+)

Group numbering works as before:


QUESTION 12:

Examine the following:

(((rat )bat )cat )(dog)

What subexpression does group 4 consist of?