([a-z]*([0-9]*))(X+)
Three groups. Group 0 does not count. Groups can be nested withing groups.
Review: to determine the number of a group, scan the expression left to right.
The first left parenthesis starts group 1, the second left parenthesis starts group 2,
and so on. Of course, each left parenthesis must have a matching right parenthesis
which shows the end of the group.
The groups of the Matcher are filled in during the matching process.
If no match has been performed, there is no group data.
If a group()
method is called before a match, an
IllegalStateException
is thrown.
Do you always want to match an entire string?