[Python-bugs-list] [Bug #115040] sre behavior differes from pre

noreply@sourceforge.net noreply@sourceforge.net
Thu, 21 Sep 2000 20:15:56 -0700


Bug #115040, was updated on 2000-Sep-21 19:53
Here is a current snapshot of the bug.

Project: Python
Category: Library
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Summary: sre behavior differes from pre

Details: This may not be a bug, but it caused some regexes of mine that match under pre to fail under sre.

With pre, an embeded flag like "(?x)" can appear anywhere within a regex and it affects the entire regex. In sre, the position of "(?x)" is important; only after it appears does VERBOSE mode seem to be in effect and whitespace is ignored. If people haven't been careful to place the "(?x)" at the very beginning of the regex, VERBOSE regexes with this defect in existing code may fail to match when sre is used as a drop-in replacement for pre.

Also, and in contrast, "(?s)" doen't seem sensitive to position under sre; wherever it appears in the regex, DOTALL seems to affect the entire regex.


Follow-Ups:

Date: 2000-Sep-21 20:15
By: tim_one

Comment:
Assigned to Fredrik.  FWIW, years ago I never did figure out Perl did in all cases simply by trying stuff; e.g., it's easy to construct cases where whether (?x) is recognized as such depends on whether you're assuming verbose mode or not while you're parsing!
-------------------------------------------------------

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