title: Replace captured groups with empty string in python
body: <p>I currently have a string similar to the following:</p>
  
  <pre><code>str = 'abcHello Wor=A9ld'
  </code></pre>
  
  <p>What I want to do is find the 'abc' and '=A9' and replace these matched groups with an empty string, such that my final string is 'Hello World'.</p>
  
  <p>I am currently using this regex, which is correctly finding the groups I want to replace:</p>
  
  <pre><code>r'^(abc).*?(=[A-Z0-9]+)'
  </code></pre>
  
  <p>I have tried to replace these groups using the following code:</p>
  
  <pre><code>clean_str = re.sub(r'^(abc).*?(=[A-Z0-9]+)', '', str)
  </code></pre>
  
  <p>Using the above code has resulted in:</p>
  
  <pre><code>print(clean_str)
  &gt;&gt;&gt; 'ld'
  </code></pre>
  
  <p>My question is, how can I use re.sub to replace these groups with an empty string and obtain my 'Hello World'?</p>