title: Replace password in connection string with regular expression in C#
body: <p>I'm trying to create a regular expression in C# that will replace the password of a connection string so that it is not shown when I display it on a page.  The connection string password are somewhere in the string as PWD=password;</p>
  
  <p>So far I have:</p>
  
  <pre><code>Regex.Replace(connStr, "PWD=.*;", "PWD=********");
  </code></pre>
  
  <p>This works to find the beginning of the pattern, but the problem is the wild card (.*) is also including the ; so the pattern is never terminated and the remainder of the string is replaced too.  How can I say everthing but a ; in my RegEx?</p>
  
  <p>Thanks.</p>