title: Accessing prematch, match and postmatch in Python regular expressions
body: <p>When matching a regular expression in Perl, <a href="https://perldoc.perl.org/perlreref.html#VARIABLES" rel="nofollow noreferrer">three variables named <code>$PREMATCH</code>, <code>$MATCH</code> and <code>$POSTMATCH</code> are set</a>, containing the parts of the input string before the match, the match itself, and the part after.</p>
  
  <p>How can I access the same values using Python regular expressions?</p>