title: Match groups in Python
body: <p>Is there a way in Python to access match groups without explicitly creating a match object (or another way to beautify the example below)?</p>
  
  <p>Here is an example to clarify my motivation for the question:</p>
  
  <p>Following Perl code </p>
  
  <pre><code>if    ($statement =~ /I love (\w+)/) {
    print "He loves $1\n";
  }
  elsif ($statement =~ /Ich liebe (\w+)/) {
    print "Er liebt $1\n";
  }
  elsif ($statement =~ /Je t\'aime (\w+)/) {
    print "Il aime $1\n";
  }
  </code></pre>
  
  <p>translated into Python</p>
  
  <pre><code>m = re.search("I love (\w+)", statement)
  if m:
    print "He loves",m.group(1)
  else:
    m = re.search("Ich liebe (\w+)", statement)
    if m:
      print "Er liebt",m.group(1)
    else:
      m = re.search("Je t'aime (\w+)", statement)
      if m:
        print "Il aime",m.group(1)
  </code></pre>
  
  <p>looks very awkward (if-else-cascade, match object creation).</p>