I trying to use .replace() to change everything between the two last slashes of this URL with "w270" but nothing happens. Am I doing something wrong? jsFiddle
<div class="post-outer">
<img src="https://1.bp.blogspot.com/-9h_QVOCOX1w/XvnuC9SucSI/AAAAAAAABJo/roFOy4Tgs64wSDtI9-dC9WyglJJdPz3fACK4BGAsYHg/w100/image.png"/>
</div>
// The RegEx target everything between the two last slashes
$('.post-outer img').attr('src').replace(/[^\/]+(?=\/[^\/]*$)/, 'w270');