Regular Expressions: large amount of or's

Francis Girard francis.girard at free.fr
Tue Mar 1 22:13:00 CET 2005


Le mardi 1 Mars 2005 22:04, André Søreng a écrit :
> That is not exactly what I want. It should discover if some of
> the predefined words appear as substrings, not only as equal
> words. For instance, after matching "word2sgjoisejfisaword1yguyg", word2
> and word1 should be detected.

Hi,

A lexer producing a DFA like the one in pyggy (see 
http://www.lava.net/~newsham/pyggy/) might be what you're looking for.

Regards,

Francis Girard




More information about the Python-list mailing list