title: Finding the word that follows a keyword with ```import re``` in python
body: <p>I try to extract the word following the word &quot;good&quot; in:</p>
  <pre><code>lu = [&quot;Don't waste your time with season two.  She could be fun if she wasn't so hateful inside.  Not good.*  Yuck.&quot;,
        &quot;I only watched one episode. It had too much nudity and sex in it. The story line was good but didn't enjoy the rest.&quot;]
  </code></pre>
  <p>the code is:</p>
  <pre><code>import re
  lu = [&quot;Don't waste your time with season two.  She could be fun if she wasn't so hateful inside.  Not good.*  Yuck.&quot;,
        &quot;I only watched one episode. It had too much nudity and sex in it. The story line was good but didn't enjoy the rest.&quot;]
  rx = re.compile(r'good\s+(\w+)')
  user = tuple(map(lambda x: x.group(1) or &quot;&quot;, map(rx.search, f)))
  print(user)
  
  </code></pre>
  <p>but the output I get is:</p>
  <pre><code>AttributeError: 'NoneType' object has no attribute 'group'
  </code></pre>
  <p>the output I wish to obtain is:</p>
  <pre><code>('Yuck', 'but')
  </code></pre>
  <p>or:</p>
  <pre><code>(['Yuck'], ['but'])
  </code></pre>
  <p>when I remove the dots (.) from <code>lu</code> the program runs without error, but I do not want to remove the dots (.) manually. Someone who can help me please</p>