title: Using regular expressions to remove relative path slashes
body: <p>I am trying to remove all the relative image path slashes from a chunk of HTML that contains several other elements.</p>
  
  <p>For example</p>
  
  <pre><code>&lt;img src="../../../../images/upload/1/test.jpg /&gt;
  </code></pre>
  
  <p>would need to become</p>
  
  <pre><code>&lt;img src="http://s3.amazonaws.com/website/images/upload/1/test.jpg" /&gt;
  </code></pre>
  
  <p>I was thinking of writing this as a rails helper, and just passing the entire block into the method, and make using Nokogiri or Hpricot to parse the HTML instead, but I don't really know.</p>
  
  <p>Any help would be great</p>
  
  <p>Cheers
  Adam</p>