title: Search and replace in Visual Studio
body: <p>In Visual Studio, when I search within a selection, I want to replace the first instance (or second, third, etc.) of a match per line using regular expressions. How would I do this?</p>
  
  <p>Search and replace</p>
  
  <pre><code>foo1 = foo1;
  foo2 = foo2;
  ...
  foo20 = foo20;
  </code></pre>
  
  <p>into the following.</p>
  
  <pre><code>foo1 = bar1;
  foo2 = bar2;
  ...
  foo20 = bar20;
  </code></pre>