Nathan Harmston <iwanttobeabad...@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. -- http://mail.python.org/mailman/listinfo/python-list