title: Regexp-replace: Multiple replacements within a match
body: <p>I'm converting our MVC3 project to use T4MVC. And I would like to replace java-script includes to work with T4MVC as well. So I need to replace </p>
  
  <pre><code>"~/Scripts/DataTables/TableTools/TableTools.min.js"
  "~/Scripts/jquery-ui-1.8.24.min.js"
  </code></pre>
  
  <p>Into </p>
  
  <pre><code>Scripts.DataTables.TableTools.TableTools_min_js
  Scripts.jquery_ui_1_8_24_min_js
  </code></pre>
  
  <p>I'm using Notepad++ as a regexp tool at the moment, and it is using POSIX regexps.
  I can find script name and replace it with these regexps:</p>
  
  <p>Find: <code>\("~/Scripts/(.*)"\)</code></p>
  
  <p>Replace with <code>\(Scripts.\1\)</code></p>
  
  <p>But I can't figure out how do I replace dots and dashes in the file names into underscores and replace forward slashes into dots.</p>
  
  <p>I can check that js-filename have dot or dash in a name with this</p>
  
  <pre><code> \("~/Scripts/(?=\.*)(?=\-*).*"\)
  </code></pre>
  
  <p>But how do I replace groups within a group?</p>
  
  <p>Need to have non-greedy replacement within group, and have these replacements going in an order, so forward slashes converted into a dot will not be converted to underscore afterwards.</p>
  
  <p>This is a non-critical problem, I've already done all the replacements manually, but I thought I'm good with regexp, so this problem bugs me!!</p>
  
  <p>p.s. preferred tool is Notepad++, but any POSIX regexp solution would do -)</p>
  
  <p>p.p.s. <a href="http://pastebin.com/Av3mTbyn" rel="nofollow noreferrer">Here you can get a sample</a> of stuff to be replaced
  <a href="http://pastebin.com/PvgEmJNr" rel="nofollow noreferrer">And here is the the target text</a></p>