[Python-Dev] Should we move to replace re with regex? (original) (raw)

Ezio Melotti ezio.melotti at gmail.com
Sun Aug 28 05:19:15 CEST 2011


On Sun, Aug 28, 2011 at 3:48 AM, Terry Reedy <tjreedy at udel.edu> wrote:

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.)

I would actually prefer to replace re.

Before doing that we should make a list of all the differences between the two modules (possibly in the PEP). On the regex page on PyPI there's already a list that can be used for this purpose 0. For bug fixes it shouldn't be a problem if the behavior changes. New features shouldn't bring any backward-incompatible behavioral changes, and, as far as I understand, Matthew introduced the NEW flag [1], to avoid problems when they do.

I think re should be kept around only if there are too many incompatibilities left and if they can't be fixed in regex.

Best Regards, Ezio Melotti

[1]: "The NEW flag turns on the new behaviour of this module, which can differ from that of the 're' module, such as splitting on zero-width matches, inline flags affecting only what follows, and being able to turn inline flags off." -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20110828/ea30cb1a/attachment.html>



More information about the Python-Dev mailing list