Name
end, span, start
Synopsis
m
.end(groupid
=0)m
.span(groupid
=0)m
.start(groupid
=0)
These methods return the delimiting indices, within
m
.string
, of the
substring matching the group identified by
groupid
, where
groupid
can be a group number or name.
When the matching substring is
m
.string[
i
:j
]
,
m
.start
returns
i
,
m
.end
returns
j
, and
m
.span
returns
(
i
,
j
)
. When the group did
not participate in the match, i
and
j
are -1
.
Get Python in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.