This is identical to m.group(g). This allows easier access to an individual group from a match:
Match.__getitem__(g)
>>> m = re.match(r"(\w+) (\w+)", "Isaac Newton, physicist")
>>> m[0] The entire match
'Isaac Newton'
>>> m[1] The first parenthesized subgroup.
'Isaac'
>>> m[2] The second parenthesized subgroup.
'Newton'
>>> m = re.match(r"(?P<first_name>\w+) (?P<last_name>\w+)", "Isaac Newton")
>>> m['first_name']
'Isaac'
>>> m['last_name']
'Newton'