title: C# Regex.Replace first group
body: <p>How can I use the first group in Regex.Replace?<br>
  I've tried using <code>$1</code> like the <a href="http://msdn.microsoft.com/en-us/library/taz3ak2f.aspx" rel="nofollow">documentation</a> said. Also it doesn't matter if I use grouping with <code>?:</code> or not...</p>
  
  <pre><code>string text = "&amp;lt;font color=&amp;quot;#aa66bb&amp;quot;&amp;gt;farbig&amp;lt;/font&amp;gt;"     
  
  /// this does not work
  Regex.Replace(text, "&amp;lt;font color=&amp;quot;#(?:[\\d\\w]{6})&amp;quot;&amp;gt;", "&lt;font color=\"#$1\"&gt;");
  // =&gt; "&lt;font color=\"#$1\"&gt;farbig&amp;lt;/font&amp;gt;"
  
  // this works fine though  
  Regex.Match(text, "&amp;lt;font color=&amp;quot;#([\\d\\w]{6})&amp;quot;&amp;gt;").Groups[1];
  // =&gt; aa66bb
  </code></pre>
  
  <p>So what am I doing wrong here?</p>