title: looking for a tuple matching algorithm
body: <p>I need to implement an in-memory tuple-of-strings matching feature in C.  There will be large list of tuples associated with different actions and a high volume of events to be matched against the list.</p>
  
  <p>List of tuples:</p>
  
  <pre><code>("one", "four")
  ("one")
  ("three")
  ("four", "five")
  ("six")    
  </code></pre>
  
  <p>event ("one", "two", "three", "four") should match list item ("one", "four") and ("one") and ("three") but not ("four", "five") and not ("six")</p>
  
  <p>my current approach uses a map of all tuple field values as keys for lists of each tuple using that value.  there is a lot of redundant hashing and list insertion.</p>
  
  <p>is there a right or classic way to do this?</p>