[Python-ideas] Matching multiple regex patterns simultaneously

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Mar 5 00:07:55 CET 2010

Andrey Fedorov wrote:
> So a couple of libraries (Django being the most popular that comes to mind)
> try to match a string against several regex expressions. I'm wondering if
> there exists a library to "merge" multiple compiled regex expressions into a
> single lookup.

The only thing I'm aware of at the moment is my own
Plex library, but it's currently implemented in pure
Python, so it's not as efficient as the re module
with an extension like this would be.

I have a half-finished project on the back burner
to reimplement the core of Plex using Pyrex, but
it's been languishing for so long that the burner
has probably gone out by now. Maybe I should
relight it...


More information about the Python-ideas mailing list