title: Using Rabin-Karp to search for multiple patterns in a string
body: <p>According to the <a href="http://en.wikipedia.org/wiki/Rabin-Karp_string_search_algorithm" rel="noreferrer">wikipedia entry</a> on Rabin-Karp string matching algorithm, it can be used to look for several different patterns in a string at the same time while still maintaining linear complexity. It is clear that this is easily done when all the patterns are of the same length, but I still don't get how we can preserve O(n) complexity when searching for patterns with differing length simultaneously. Can someone please shed some light on this? </p>
  
  <p>Edit (December 2011):</p>
  
  <p>The wikipedia article has since been updated and no longer claims to match multiple patterns of differing length in O(n).</p>