title: python re.sub() with ?P
body: <p>Can I use a variable from the first argument of re.sub (), to use it in the second argument? Let me explain with an example:</p>
  
  <pre><code>re.sub(r'(?P&lt;id&gt;&gt;&gt;&gt;[0-9]+)', 'sometext(?P=id)sometext', self.text))
  </code></pre>
  
  <p>Can I use id variable in 'sometext(?P=id)sometext'? Actually, this code dont work, so i came here.</p>