How to check if any item from a list of strings is in a big string?

denis denis-bz-gg at
Wed Jul 15 06:46:23 EDT 2009

Sure, Aho-Corasick is fast for fixed strings; but without real
numbers / a concrete goal
> > Matt, how many words are you looking for, in how long a string ?

a simple solution is good enough, satisficing.  Matt asked "how to
make that function look nicer?"
but "nice" has many dimensions -- bicycles are nice for some tasks,
Ferraris for others.

Bytheway has a
link to a Python implementation,
also is fun.

More information about the Python-list mailing list