title: Search through list of strings and determine if there is an exact match in separate list of strings. python. sentiment analysis
body: <p>Suppose I have a list of keywords and a list of sentences:</p>
  
  <pre><code>keywords = ['foo', 'bar', 'joe', 'mauer']
  listOfStrings = ['I am frustrated', 'this task is foobar', 'mauer is awesome']
  </code></pre>
  
  <p>How can I loop through my listOfStrings and determine if they contain any of the keywords...Must be an exact match!  Such that:</p>
  
  <pre><code>&gt;&gt;for i in listOfStrings:
      for p in keywords:
         if p in i:
           print i
  
  &gt;&gt; 'mauer is awesome'
  </code></pre>
  
  <p>(because 'foobar' is NOT an exact match with 'foo' or 'bar', function should only catch 'foobar' if it is a keyword)</p>
  
  <p>I suspect re.search may be the way, but I cant figure out how to loop through list, using variables rather than verbatim expressions using the re module.<br>
  Thanks</p>