March 2003
Intermediate to advanced
656 pages
39h 30m
English
group
m.group(groupid=0,*groupids)When called with a single argument groupid
(a group number or name), group returns the
substring matching the group identified by
groupid, or None if
that group did not participate in the match. The common idiom
m
.group( ), also
spelled m
.group(0),
returns the whole matched substring, since group number
0 implicitly means the whole regular expression.
When group is called with multiple arguments, each
argument must be a group number or name. group
then returns a tuple with one item per argument, the substring
matching the corresponding group, or None if that
group did not participate in the match.
Read now
Unlock full access