title: What's the correct Try Exception for NoneType when using regex's .groups() function
body: <p>I'm trying to use the following code:</p>
  
  <pre><code>try:
      clean = filter(None, re.match(r'^(\S+) (.*?) (\S+)$', full).groups())
  except TypeError:
      clean = ""
  </code></pre>
  
  <p>However I get the following traceback...</p>
  
  <pre><code>Traceback (most recent call last):
    File "test.py", line 116, in &lt;module&gt;
      clean = filter(None, re.match(r'^(\S+) (.*?) (\S+)$', full).groups())
  AttributeError: 'NoneType' object has no attribute 'groups'
  </code></pre>
  
  <p>What is the correct exception / correct way around this problem?</p>