|
|
Subscribe / Log in / New account

Python support for regular expressions

Python support for regular expressions

Posted Feb 26, 2022 0:58 UTC (Sat) by rra (subscriber, #99804)
In reply to: Python support for regular expressions by simcop2387
Parent article: Python support for regular expressions

Speaking as the maintainer of two dual-life Perl modules, this has long been one of my favorite parts of the Perl ecosystem and I would strongly encourage Python to adopt it.

As the module maintainer, this is the best of both worlds for me. I can release more quickly than Perl itself and test changes and new features, Perl will pick up the stable version during its release cycles, and people who desperately need the new version for some reason can depend on it directly with a version bound, which will trigger the correct behavior from various module managers.


to post comments

Python support for regular expressions

Posted Mar 10, 2022 1:26 UTC (Thu) by bartoc (guest, #124262) [Link]

Speaking as a C++ standard library maintainer (we have probably the worst regex module on the face of the earth, it makes python's re look like alien technology) I think you're right. We have a major problem in C++ with people trying to basically use the standard library as a package manager and wanting things in the standard library just because that means they don't have to install anything, without really thinking about what that means in terms of who maintains the thing (turns out, C++ library maintainers aren't expert regex engine implementers, who knew). C++ makes this worse because the standard library promises to maintain ABI forever (essentially).

The re module is fine for a lot of stuff, we use it in some python scripts related to our build system and test harness, and we wouldn't want to use regex from pip since re works well enough for us, and regex doesn't come pre-installed. That said if it _did_ come pre-installed I'd be tempted to go through and upgrade all our python scripts, even if it was maintained and released on a schedule separate from the standard library proper.

Sidenote: I really like raku/perl6's alternate regex syntax, it's nice.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds