1. A method, comprising: representing a plurality of keywords by a list of substrings drawn from the keywords; caching a set of flags, each flag indicating whether a respective substring occurs in one or more of the keywords, in an internal cache memory of a processor device; identifying, using the processor device, locations in input data in which the substrings occur by comparing the input data with the cached flags; and searching at the identified locations for occurrences of the keywords, so as to find at least one of the keywords in the input data.