title: Regular Expression Uppercase Replacement in C#
body: <p>I have the following C# which simply replaces parts of the input string that look like EQUIP:19d005 into URLs, like this:</p>
  
  <pre><code>input = Regex.Replace(input, @"(EQUIP:)(\S+)", @"&lt;a title=""View equipment item $2"" href=""/EquipmentDisplay.asp?eqnum=$2""&gt;$1$2&lt;/a&gt;", RegexOptions.IgnoreCase);
  </code></pre>
  
  <p>The HTML ends up looking like this.</p>
  
  <pre><code>&lt;a title="View equipment item 19d005" href="/EquipmentDisplay.asp?eqnum=19d005"&gt;EQUIP:19d005&lt;/a&gt;
  </code></pre>
  
  <p>The only trouble is that the destination page expects the eqnum querystring to be all UPPERCASE so it returns the correct equipment when eqnum=19D005 but fails if it receives eqnum=19d005.</p>
  
  <p>I guess I can modify and correct EquipmentDisplay.asp's errant requirement of uppercase values however, if possible I'd like to make the C# code comply with the existing classic ASP page by uppercasing the $2 in the Regex.Replace statement above.</p>
  
  <p>Ideally, I'd like the HTML returned to look like this:</p>
  
  <pre><code>&lt;a title="View equipment item 19d005" href="/EquipmentDisplay.asp?eqnum=19D005"&gt;EQUIP:19d005&lt;/a&gt;
  </code></pre>
  
  <p><em>Notice although the original string was EQUIP:19d005 (lowercase), only the eqnum= value is uppercased.</em></p>
  
  <p>Can it be done and if so, what's the tidiest way to do it?</p>