I had following string ,
const str= "this is harp//foo.eps and harp//data.eps"
I need to replace the string between harp to .eps
My code below,
const str = "this is harp//foo.eps and harp//data.eps"
const data = str.replace(/\harp.*\eps/, 'www.imge.jpg');
console.log(data);
it was returning output below,
this is www.imge.jpg
But expected output
this is www.imge.jpg and www.imge.jpg
.*?