0

hi i have one XML file i just want to replace some path in XML. XML hold path of some images like it has many record like below

tile5url="images/Balcony Sunset Pano_o_480_5.jpg"

so i just want to replace path . i just want to replace "images/" with some other path like "newfolder/images/" or anythings else i have used javascript to read XML using XMLHttpRequest object and generate responseText to read XML

Thanks

3
  • So what's the problem. Go ahead! Commented Feb 6, 2014 at 7:36
  • tile5url.replace(/(images\/)/, 'newfolder/$1'); Commented Feb 6, 2014 at 7:39
  • possible duplicate of Javascript replace string regex Commented Feb 6, 2014 at 9:05

1 Answer 1

0

Try this:

 /tile5url="(images\/[^"]+)"/

And replace with

 tile5url="newfolder/$1"   

Demo

http://regex101.com/r/gB4oT5

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.