title: Visual Studio regex replace repeated capturing group
body: <p>I'm working on a fairly large project (c#) and from place to place I have snippets that looks like this:</p>
  
  <pre><code>((int)foo).ToString() + "," + ((int)bar).ToString() + "," + ((int)zig).ToString() + ...
  </code></pre>
  
  <p>The comma delimited string has arbitrary length (average range from 1 to 5, but I'm not sure whether there's more). so far I'm able to find all the occurrences I want using:</p>
  
  <pre><code>\({.+}\).ToString\(\)( *\+ *"," *\+ *\({.+}\).ToString\(\))*
  </code></pre>
  
  <p>now for each of the occurrence I want to replace it with something like this:</p>
  
  <pre><code>{ (int)foo, (int)bar, (int)zig , ...}
  </code></pre>
  
  <p>replacing each occurrence manually is not feasible, is there a replace regex that does the job?</p>
  
  <p>Thanks</p>