Regexp optimization question

Günter Jantzen nc-jantzegu at netcologne.de
Fri Apr 23 01:12:58 EDT 2004


"Magnus Lie Hetland" <mlh at furu.idi.ntnu.no> schrieb im Newsbeitrag
news:slrnc8gal3.9da.mlh at furu.idi.ntnu.no...
>
> Any ideas?
>

Maybe Plex is helpful. I did not use it already, but it seems to adress your
problem
The author of Plex is Greg Ewing. He build Pyrex on top of Plex

The documentation
http://www.cosc.canterbury.ac.nz/~greg/python/Plex/version/doc/index.html
contains

"""
Plex is designed to fill a need that is left wanting by the existing Python
regular expression modules. If you've ever tried to use one of them for
implementing a scanner, you will have found that they're not really suited
to the task. You can define a bunch of regular expressions which match your
tokens all right, but you can only match one of them at a time against your
input. To match all of them at once, you have to join them all together into
one big r.e., but then you've got no easy way to tell which one matched.
This is the problem that Plex is designed to solve.
"""

Hope I could help you
Guenter





More information about the Python-list mailing list