title: Perl like regex in Python
body: <p>In Perl I would do something like this for taking different fields in a regexp, separating different fields by () and getting them using $</p>
  
  <pre><code>foreach $line (@lines)
  {
   $line =~ m/(.*?):([^-]*)-(.*)/;
    $field_1 = $1
    $field_2 = $2
    $field_3 = $3
  }
  </code></pre>
  
  <p>How could I do something like this in Python?</p>