[Python-bugs-list] [Bug #117612] sre gives wrong groups with findall and empty groups

noreply@sourceforge.net noreply@sourceforge.net
Sat, 28 Oct 2000 06:39:46 -0700


Bug #117612, was updated on 2000-Oct-24 11:01
Here is a current snapshot of the bug.

Project: Python
Category: Modules
Status: Open
Resolution: None
Bug Group: None
Priority: 7
Summary: sre gives wrong groups with findall and empty groups

Details: the following:

r = re.compile (r'(a|(b))')
print r.findall (r'aba')

produces with sre

[('a', ''), ('b', 'b'), ('a', 'b')]

instead of the correct behaviour of pre (and Python 1.5.2)

[('a', ''), ('b', 'b'), ('a', '')]

(Note the wrong 'b' in the last tuple. It seems like groups are not initialized and keep the value of the previous match).

Tested with BeOpen Python 2.0 final (Oct. 16th) under Linux 2.2.14 (S.u.S.E 6.4)

Follow-Ups:

Date: 2000-Oct-28 06:39
By: effbot

Comment:
the local match state isn't properly reset between items.

fixed in my local copy.  I'll update the CVS version as
soon as I've fixed the regression suite.

thanks /F
-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=117612&group_id=5470