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

noreply@sourceforge.net noreply@sourceforge.net
Tue, 24 Oct 2000 11:01:31 -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: 5
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)

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