I'm trying to use String.replace() with a regular expression to replace a matched expression.
Like so:
var newStr = loc.replace(/Slide(\d*)/,(i+1));
This expression turns
https://xxxxxxx.net/qa/club/Slide1.PNG
into
https://xxxxxxx.net/qa/club/1.PNG
I just want to replace the numbers after "Slide", without removing the word. How can I do this?