title: Regex replace in multiple files
body: <p>I need to replace all instances of a regex with another regex in multiple files that are in multiple directories under a root directory.</p>
  
  <p>Example:
  File Structure:</p>
  
  <pre><code>.
  |---src
  |   |---Module
  |   |   |---someclass.cpp
  |   |---main.cpp
  |
  |---include
      |---Module
          |---someclass.hpp
  </code></pre>
  
  <p>basically that but with more files and folders.</p>
  
  <p>I need to search for the regex <code>\(std::vector&lt;.*&gt;</code> and replace all instances of it with <code>\(std::vector&lt;.*&gt; const&amp;</code>
  The tricky part seems to be making sure the content between <code>&lt;</code> and <code>&gt;</code> stays the same.</p>
  
  <p>For example it would match <code>(std::vector&lt;int&gt;</code> and replace it with <code>(std::vector&lt;int&gt; const&amp;</code>.
  A more complex example would be:<br>
  Match: <code>(std::vector&lt;std::map&lt;std::string, int&gt;&gt;</code><br>
  Replace with: <code>(std::vector&lt;std::map&lt;std::string, int&gt;&gt; const&amp;</code></p>