title: How to return None in regex groups?
body: <p>How can I print out None in groups(), if the specific character is not found in the regex? First capture group should return None or 'S', but I'm having trouble returning None in print(t.groups()).</p>
  
  <pre><code>rx = r'^([S])([Nn]+)([m])([f]|[d])$'
  
  t = re.match( rx , 'NNmf' )
  
  print( t.groups() )
  </code></pre>
  
  <p>This is what I have tried so far, also using '?:' for not numbered capture group hoping it will return 'None' but no luck.</p>
  
  <pre><code>(None , ' NN ' , ' m ' , ' f ' )
  </code></pre>
  
  <p>Result should look above, currently I'm getting "AttributeError: 'NoneType' object has no attribute 'groups'".</p>
  
  <p>Any suggestions will be much appreciated!</p>