title: How to replace a matched group value with Regex
body: <p>I would like to modify the value of the "data source" component in a connection string. I'm thinking of the following solution:</p>
  
  <p>Using this regex pattern:</p>
  
  <pre><code>"data source\=((\w|\-)+?\\{1}\w+?)\;"
  </code></pre>
  
  <p>I can obtain the following string matches:</p>
  
  <pre><code>Match.Groups[0].Value = "data source=MY-PC\SQLEXPRESS;"
  Match.Groups[1].Value = "MY-PC\SQLEXPRES"
  </code></pre>
  
  <p>So in the connection string firstly I would like to find the part matching with the "data source=something;", and secondly replace just the "something" in the connection string. How to do that?</p>