[Python-Dev] Should we move to replace re with regex?

Terry Reedy tjreedy at udel.edu
Sun Aug 28 02:48:02 CEST 2011


On 8/27/2011 7:39 PM, Greg Ewing wrote:
> Nick Coghlan wrote:
>
>> The next step needed is for someone to volunteer to write and champion
>> a PEP that:
>
> Would it be feasible and desirable to modify regex so
> that it *is* backwards-compatible with re, with a view
> to making it a drop-in replacement at some point?
>
> If not, the PEP should discuss this also.

Many of the things regex does differently might be called either bug 
fixes or feature changes, depending on one's viewpoint. Regex should 
definitely not be 'bug-compatible'.

I think regex should be unicode-standard compliant as much as possible, 
and let the chips fall where they may. If so, it would be like the 
decimal module, which closely tracks the IEEE decimal standard, rather 
than the binary float standard. Regex is already much more compliant 
than re, as shown by Tom Christiansen. This is pretty obviously 
intentional on MB's part. It is also probably intentional that re *not* 
match today's Unicode TR18 specifications.

These are reasons why both Ezio and I suggested on the tracker adding 
regex without deleting re. (I personally would not mind just replacing 
re with regex, but then I have no legacy re code to break. So I am not 
suggesting that out of respect for those who do.)

-- 
Terry Jan Reedy



More information about the Python-Dev mailing list