I want to delete size data from a file name, e.g.
var src = 'http://az648995.vo.msecnd.net/win/2015/11/Halo-1024x551.jpg';
src = src.replace(
/-\d+x\d+(.\S+)$/,
function( match, contents, offset, s ) {
return contents;
}
);
it works as expected and I get
http://az648995.vo.msecnd.net/win/2015/11/Halo.jpg
But if I have a file name like
http://az648995.vo.msecnd.net/win/2015/11/slot-Drake-08-2000x1000-1024x512.jpg
he returns
http://az648995.vo.msecnd.net/win/2015/11/slot-Drake-08-1024x512.jpg
instead of the desired
http://az648995.vo.msecnd.net/win/2015/11/slot-Drake-08-2000x1000.jpg
source
share