title: Regex to shrink Path.Combine Relative to Absolute
body: <p>I have 2 file paths:</p>
  
  <p>absolute:</p>
  
  <pre><code>/Content/assets2/otherfolder/another/this/
  </code></pre>
  
  <p>relative:</p>
  
  <pre><code>../../../../assets/img/logo.gif
  </code></pre>
  
  <p>when I do Path.Combine(absolute, relative) I get:</p>
  
  <pre><code>/Content/assets2/otherfolder/another/this/../../../../assets/img/logo.gif
  </code></pre>
  
  <p>which works fine, but what I want to get:</p>
  
  <pre><code>/Content/assets/img/logo.gif
  </code></pre>
  
  <p>I need a Regex or code that removes the "../" with the corresponding folder:</p>
  
  <pre><code>/Content/assets2/otherfolder/another/this/../../../../assets/img/logo.gif
  /Content/assets2/otherfolder/another/../../../assets/img/logo.gif
  /Content/assets2/otherfolder/../../assets/img/logo.gif
  /Content/assets2/../assets/img/logo.gif
  </code></pre>
  
  <p>finally into:</p>
  
  <pre><code>/Content/assets/img/logo.gif
  </code></pre>