I have massive html code, with loooads of images, problem is, every single image has a different path, example:
<img src="../media/2010/01/something.jpg" />
<img src="../media/logo.png" />
What I wanted to do with regular expressions is, to find every image path and replace it with:
<img src="../img/FILENAME.EXTENSION" />
I know that it’s definately possible with regular expressions … but it’s just not my cup of tea, could any1 help me please?
Cheers, Mart
This might not be the best solution but it might work:
and then you use capture group 1 and 3 to create the new string (depending on flavor):
You can see it in action here: http://regexr.com?2v8ir