I have a huge filename string list, using the regex to to replace only if the string filename has .jpg or .png extension
Means to say if the filename is
Scene.jpg then expected result is IMG_Scene.jpg.
Scenejpgx.docx then expected result is Scenejpgx.docx itself
I tried with
str.replace(/^/i,"IMG_");
but this replaces every strings.