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

denis denis-bz-gg at t-online.de
Mon Jul 13 09:11:09 EDT 2009


Matt, how many words are you looking for, in how long a string ?
Were you able to time any( substr in long_string ) against re.compile
( "|".join( list_items )) ?
(REs are my method of choice, but different inputs of course give
different times --
see google regex speed site:groups.google.com /
site:stackoverflow.com .)

cheers
  -- denis





More information about the Python-list mailing list