I am working with jQuery and trying to write a template replacement, but this will not work. I have it:
var $featured_rewrite = $('#featured').not('.slideshow'); $featured_rewrite.children().attr('href', $featured_rewrite.find('img').attr('src').replace('/-[0-9]+x[0-9]+\./i', '.'));
I don't understand why something like this works:
.replace('-500x277.', '.')
but not that I even checked with the tool and made sure that it is valid and works:
.replace('/-[0-9]+x[0-9]+\./i', '.')
source share