title: Python - Check if keyword from list is in string (as a whole word) & return found keyword
body: <p>Haven't found a solution particularly for this idea, so here's my question.</p>
  <p>I have a list of keywords that I want to match with a scraped string from a website. This list is stored in an own Python file &quot;Keywords&quot; with the following content:</p>
  <pre><code>keywords = [
      &quot;FDA&quot;,
      &quot;Contract&quot;,
      &quot;Vaccine&quot;,
      &quot;Efficacy&quot;,
      &quot;SARS&quot;,
      &quot;COVID-19&quot;,
      &quot;Cancer&quot;,
      &quot;Exclusive&quot;,
      &quot;Explosive&quot;,
      &quot;Hydrogen&quot;,
      &quot;Positive&quot;,
      &quot;Phase&quot;
  ]
  </code></pre>
  <p>The file is imported and to access this list, I can use <code>Keywords.keywords</code>.</p>
  <p><strong>#1 Match keywords with string:</strong></p>
  <p>I want to check whether the scraped string <code>article_title = item.select_one('h3 small').find_next_sibling(text=True).strip()</code> contains one of these keywords. If it does, I want to search for more content (got the code already). Else, I will <em>return</em> to the beginning of my for loop and search through the next title.</p>
  <p>Here are examples of how the output for the string <code>article_title</code> looks like:</p>
  <pre><code>Global Water and Sewage Market Report (2021 to 2030) - COVID-19 Impact and Recovery
  Blackbaud CEO Mike Gianoni Named One of 50 Most Influential by Charleston Business Magazine
  Statement from Judy R. McReynolds on Signing of HR1319, the American Rescue Plan Act of 2021
  </code></pre>
  <p>What's the best way to match the list of keywords with the strings by only searching for whole words? I have found multiple approaches on SO, but they all seem to have flaws that people point out which confuses me.</p>
  <p><strong>#2 Store the found keyword in variable:</strong></p>
  <p>When matching with the keyword works, I store the found <code>article_title</code> variable and other variables in a database in case a keyword was found. However, I also want to store the keyword which caused the entry in my database. This allows me to know how many times each keyword was found. The variable where I store the found keyword should be called <code>article_keyword</code>. Is there a way to not only match the keywords with a string but also to store the found keyword? If yes, I would gladly appreciate help on how to do this.</p>
  <p><strong>If the provided information is not enough, let me know by a comment and I will add the full code. Just left it out for reasons of shorting the questions.</strong></p>