Large regular expressions

Alain Ketterlin alain at dpt-info.u-strasbg.fr
Mon Mar 15 08:50:27 EDT 2010


Nathan Harmston <iwanttobeabadger at googlemail.com> writes:

[...]
> Could anyone suggest other methods of these kind of string matching in
> Python? I m trying to see if my swigged alphabet trie is faster than
> whats possible in Python!

Since you mention using a trie, I guess it's just a big alternative of
fixed strings. You may want to try using the Aho-Corasick variant. It
looks like there are several implementations (google finds at least
two). I would be surprised if any pure python solution were faster than
tries implemented in C. Don't forget to tell us your findings.

-- Alain.



More information about the Python-list mailing list