Quote:
Originally Posted by BJN01
but , the script doesn't want to do its job ... am I doing something wrong then?
|
Split/join can be used when find/replace parameters are both strings. Since you are using regex here, you will need to use it as find parameter and, str (static) or capture groups as replace parameter.
Code:
var replace = function(a, b) {
i.name = i.name.replace(a, b);
}
replace(/(\d+)(-[a-z0-9]{64})(\.(?:jpg|png))$/, "$1$3");