Issue 433024: SRE: (?flag) isn't properly scoped (original) (raw)

Issue433024

Created on 2001-06-14 08:26 by effbot, last changed 2022-04-10 16:04 by admin. This issue is now closed.

Messages (5)
msg53160 - (view) Author: Fredrik Lundh (effbot) * (Python committer) Date: 2001-06-14 08:26
from the jeffrey friedl report: The way (?i) works now is that if it appears anywhere in the regex, it turns on case-insensative matching for the entire regex. This is different (and less useful) than how Perl or Sun's Java package does it [I'm pretty sure SRE does it this way to exactly match the version of PCRE used in 1.5.2, but maybe it's time to move forward... /F]
msg63644 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2008-03-17 14:01
This is still a valid issue. (As of Python 2.6a1+ (trunk:61434, Mar 17 2008, 08:06:54).) >>> bool(re.match("abc(?i)","AbC")) True The documentation says that the behavior of a regex with (?) not at the beginning is undefined. Short of implementing Java/Perl behavior, this should be made an error rather than undefined so that users porting their code from Java/Perl get an early warning.
msg73685 - (view) Author: Matthew Barnett (mrabarnett) * (Python triager) Date: 2008-09-24 00:38
Implemenetd in #3825.
msg114617 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-08-22 00:03
I don't think this should be changed anymore, at least not without a flag. Anyway, it is implemented in #2636.
msg230851 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-11-08 12:27
See also .
History
Date User Action Args
2022-04-10 16:04:07 admin set github: 34623
2014-11-08 12:27:50 serhiy.storchaka set nosy: + serhiy.storchakamessages: +
2010-08-22 00:03:21 georg.brandl set status: open -> closednosy: + georg.brandlmessages: + superseder: Major reworking of Python 2.5.2 re module -> Adding a new regex module (compatible with re)
2010-08-07 21:00:30 terry.reedy set resolution: out of datesuperseder: Major reworking of Python 2.5.2 re moduleversions: + Python 3.2, - Python 2.6
2009-02-12 19:35:13 ajaksu2 set dependencies: + Major reworking of Python 2.5.2 re moduleversions: + Python 2.6
2008-09-24 11:28:31 timehorse set nosy: + timehorse
2008-09-24 00:38:24 mrabarnett set nosy: + mrabarnettmessages: +
2008-04-24 21:12:50 rsc set nosy: + rsc
2008-03-17 14:01:51 belopolsky set nosy: + belopolskymessages: +
2001-06-14 08:26:00 effbot create