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

Answer:

Yes.


Many Groups

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

An expression may contain several capture groups, numbered group 0, group 1, group 2 and so on. Group 0 corresponds to the substring that matched the entire regular expression. You may have any number of groups (although the applet shows only zero through four.)

The parentheses that surround the groups in an expression must be balanced. Groups can be nested, so a group can have groups within it.

Groups are numbered from left to right starting with number one for the group formed by the leftmost parenthesis and the right parenthesis it matches.

Group number two is the group formed by the next left parenthesis and the right parenthesis that it matches, and so on. Here is an example of group numbering:

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

If the entire expression is surrounded by parentheses, then group0 and group1 correspond to the same matched substring.


QUESTION 11:

Is the following expression correct?

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