Elegant jQuery replace on mutiple values
<p>Im using .replace() with jQuery to remove different strings from an img URL:</p>

<pre><code>src = src.replace("/_w", "");
src = src.replace("_jpg", "");
src = src.replace("_jpeg", "");                 
src = src.replace("_png", "");                  
src = src.replace("_gif", "");
</code></pre>

<p>As you can see its pretty primative and not very clever, is there anyway I can replace this with something a little more elegant.</p>

<p>Essentially the url will always be 1 of the following:</p>

<pre><code>http://local.com/images/_w/image_jpg.jpg
http://local.com/images/_w/image_jpeg.jpeg
http://local.com/images/_w/image_png.png
</code></pre>

<p>Is there anyway I can write a .replace() to remove the /_w/ then remove all characters between the last '.' in the URL and the last underscore?</p>
