[Python-Dev] New regex module for 3.2?

Vlastimil Brom vlastimil.brom at gmail.com
Fri Jul 16 17:08:03 CEST 2010


2010/7/9 Georg Brandl <g.brandl at gmx.net>:
> Am 09.07.2010 02:35, schrieb MRAB:
>
>>
>> 1. Some of the inline flags are scoped; for example, putting "(?i)" at
>> the end of a regex will now have no effect because it's no longer a
>> global, all-or-nothing, flag.
>
> That is problematic.  I've often seen people put these flags at the end
> of a regex, probably for readability purposes.  IMHO it would be better
> to limit flag scoping to the explicit (?flags-flags: ) groups.
>

I just noticed the formulation on the reference page
regular-expressions.info on this kind of flags:
"(?i)	Turn on case insensitivity for the remainder of the regular
expression. (Older regex flavors may turn it on for the entire
regex.)" and likewise for other flags.

http://www.regular-expressions.info/refadv.html

I am not sure, how "authoritative" this page by Jan Goyvaerts is for
various implementations, but it looks like a very comprehensive
reference.
I think with a new regex implementation, not all of this "historical"
semantics must be copied, unless there are major real usecases, which
would be affected by this.
Just a thought;
    Vlastimil Brom


More information about the Python-Dev mailing list