[Python-bugs-list] [Bug #133283] Different re results in Python 2.0 and 2.1a2

noreply@sourceforge.net noreply@sourceforge.net
Tue, 20 Feb 2001 23:05:08 -0800


Bug #133283, was updated on 2001-Feb-20 09:52
Here is a current snapshot of the bug.

Project: Python
Category: Extension Modules
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Submitted by: kopfarzt
Assigned to : effbot
Summary: Different re results in Python 2.0 and 2.1a2

Details: The following program produces different results in Python2.0
(1.6, 1.5.2) and Python 2.1a2:

import re
rx = re.compile (r'"(?:\\"|[^"])*?"')
print rx.match (r'"\""').group (0) 

(match a double quoted string with backslash escaped quotes)

Python 1.5.2, 1.6, 2.0: "\""
Python 2.1a2: "\"

Thanks
Peter

Follow-Ups:

Date: 2001-Feb-20 23:05
By: effbot

Comment:
rx = re.compile (r'"(?:\\"|[^"]){,100}?"') works.

the bug is caused by an (obviously failed) attempt to minimize recursion
for "*?".  the checkin message says "I'm not 100% sure about this fix, but
I haven't managed to come up with any test case it cannot handle...". 
guess this is it ;-)

Thanks /F

-------------------------------------------------------

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