title: Find single or multiple words in string
body: <p>I'm trying to code a script that will find a single word or a string composed of multiple single words in a given string. I've found <a href="https://stackoverflow.com/a/5320179/1391441">this answer</a> which looks very much what I'd need, but I can't really understand how it works.</p>
  
  <p>Using the code provided in the answer mentioned above, I have this:</p>
  
  <pre><code>import re
  
  def findWholeWord(w):
      return re.compile(r'\b({0})\b'.format(w), flags=re.IGNORECASE).search
  
  st1 = 'those who seek shall find'
  st2 = 'swordsmith'
  
  print findWholeWord('seek')(st1)          # -&gt; &lt;match object&gt;
  print findWholeWord('these')(st1)         # -&gt; None
  print findWholeWord('THOSE')(st1)         # -&gt; &lt;match object&gt;
  print findWholeWord('seek shall')(st1)    # -&gt; &lt;match object&gt;
  print findWholeWord('word')(st2)          # -&gt; None
  </code></pre>
  
  <p>This function returns either something like <code>&lt;_sre.SRE_Match object at 0x94393e0&gt;</code> (when the word(s) were found) or <code>None</code> (when they weren't) and I'd like the function to return instead either <code>True</code> or <code>False</code> if the word(s) were found or not, respectively.
  Since I'm not clear on how the function is working, I'm not sure how I'd do that.</p>
  
  <p>I've never seen a function being called passing two variables (?), ie: <code>findWholeWord(word)(string)</code>, what is this doing? </p>