Name
Match Objects
Match objects are created by the match and find functions.
posendposValue of
posorendpospassed tosearchormatch.reThe regular expression object whose
matchorsearchreturned this object.stringString passed to
matchorsearch.group([g1,g2, . . .])Return one or more submatches from capturing groups. Groups may be numbers corresponding to capturing groups, or strings corresponding to named capturing groups. Group 0 corresponds to the entire match. If no arguments are provided, this function returns the entire match. Capturing groups that did not match have a result of
None.groups([default])Return a tuple of the results of all capturing groups. Groups that did not match have the value
Noneordefault.groupdict([default])Return a dictionary of named capture groups, keyed by group name. Groups that did not match have the value
Noneordefault.start([group])Index of start of substring matched by
group(or start of entire matched string if nogroup).end([group])Index of end of substring matched by
group(or end of entire matched string if nogroup).span([group])Return a tuple of starting and ending indexes of
group(or matched string if nogroup).expand([template])Return a string obtained by doing backslash substitution on
template. Character escapes, numeric backreferences, and named backreferences are expanded.lastgroupName of the last matching capture group, or
Noneif no match or if the group had no name.lastindexIndex of the last matching capture group, or ...