On Mon, Jul 12, 2010 at 9:42 AM, Steven D'Aprano <steve@pearwood.info> wrote:
On Sun, 11 Jul 2010 09:37:22 pm Eric Smith wrote:
re2 comparison is interesting from the point of if it should be included in stdlib.
Is "it" re2 or regex? I don't see having 2 regular expression engines in the stdlib.
There's precedence though... the old regex engine and the new re engine were side-by-side for many years before regex was deprecated and finally removed in 2.5. Hypothetically, re2 could similarly be added to the standard library while re is deprecated.
re2 deliberately omits some features for efficiency reasons, hence is not even on the table as a possible replacement for the standard library version. If someone is in a position where re2 can solve their problems with the re module, they should also be in a position where they can track it down for themselves. MRAB's module offers a superset of re's features rather than a subset though, so once it has had more of a chance to bake on PyPI it may be worth another look. Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia