title: c# regex to find and replace reusing part of the matched text
body: <p>I need to do a search and replace on long text strings. I want to find all instances of broken links that look like this:</p>
  
  <pre><code>&lt;a href="http://any.url.here/%7BlocalLink:1369%7D%7C%7CThank%20you%20for%20registering"&gt;broken link&lt;/a&gt;
  </code></pre>
  
  <p>and fix it so that it looks like this:</p>
  
  <pre><code>&lt;a href="/{localLink:1369}" title="Thank you for registering"&gt;link&lt;/a&gt;
  </code></pre>
  
  <p>There may be a number of these broken links in the text field. My difficulty is working out how to reuse the matched ID (in this case 1369). In the content this ID changes from link to link, as does the url and the link text.</p>
  
  <p>Thanks,</p>
  
  <p>David</p>
  
  <p>EDIT: To clarify, I am writing C# code to run through hundreds of long text fields to fix broken links in them. Each single text field contains html that can have any number of broken links in there - the regex needs to find them all and replace them with the correct version of the link.</p>