I have string like "key-original-original" and I want to replace it with "key-original-resized".
somebody help me with this by using regular expression and replace function in Javascript ?
You may try this:
var str = 'key-original-original';
var newStr = str.replace(/key\-(.*)\-(.*)/i, 'key-$1-resized');
js replacce