- experimental: added two new attributes to the match object:

"lastgroup" is the name of the last matched capturing group,
  "lastindex" is the index of the same group.  if no group was
  matched, both attributes are set to None.

  the (?P#) feature will be removed in the next relase.
This commit is contained in:
Fredrik Lundh 2000-07-02 22:25:39 +00:00
parent c9c02c4cf3
commit c2301730b8
4 changed files with 38 additions and 13 deletions

View file

@ -515,6 +515,8 @@ def _parse(source, state):
group = state.getgroup(name)
while 1:
p = _parse(source, state)
if group is not None:
p.append((INDEX, group))
if source.match(")"):
if b:
b.append(p)