Parenthesis ()
are used to enable grouping of regex phrases.
The group(1)
contains the string that is between parenthesis (.*)
so .*
in this case
And group(0)
contains whole matched string.
If you would have more groups (read (...)
) it would be put into groups with next indexes (2, 3 and so on).