title: Eclipse: Replace multiple, different regexes simultaneously
body: <p>I'm currently trying to replace an old (java) testing framework with a different, although similar, one. Therefore, as most occurences of old framework code are the same 90% of the time (in the sense of identic variable names, parameter types etc.), replacing them is pretty straightforward and rather repetitive.</p>
  
  <p>Therefore, I wrote myself a few regex matches (which work just fine, they are <em>not</em> the focus of this question).</p>
  
  <p>However, I have a rather large number of different test files, and I already at this point - just having started - have 6 different match/replacement-pairs that I would like to apply.<br>
  Now obviously, being a computer scientist, I would love to automate this, instead of going through every file, pressing Ctrl+F, pasting the matching regex, pasting the replacement regex, pressing the replace button, repeating this cycle 5 more time, and then moving to the next file.</p>
  
  <p>So, let's say for the sake of simplicity, that these are my regexes:</p>
  
  <pre><code>//matches the existing framework
  OldClass (.*?) = new OldClass("string");
  //replacement regex:
  NewClass $1 = new NewClass("string");
  
  //example replacement:
  OldClass foo = new OldClass("string");
  //becomes:
  NewClass foo = new NewClass("string");
  </code></pre>
  
  <h3>So, If I want to replace several of these match/replace-pairs in lots of different files - can I use any built-in eclipse function, or is there an extension that provides this functionality?</h3>
  
  <p>Note that I'm aware that I could write a simply java program that just skims through all my source code and applies the regexes as desired.<br>
  I'd much rather avoid spending that time, though, and especially would also like to get a chance to apply them individually to each file, so I can re-run the tests afterwards and make sure nothing is broken - which <strong>will</strong> happen, as not all of the old framework code can be replaced automatically, due to too complex &amp; specific cases. Since I'm also removing the old imports, though, this will break any still existing non-replaced code relying on now-no-longer-existing imports.</p>