Page 1 of 1

Remove path from <img src=...>

Posted: Fri Mar 31, 2006 1:45 pm
by Mr.Chaos

I have several html files, that contain images (jpg and gif). I want to strip the paths, and keep only the filename, can that be done?

They all have different codes, from which I want to remove the red parts:

<img src="">
<img src=>
<img src= height=100>
<img src="" alt="blabla">

tags like <a href=">Google</a> should stay intact!

Thanks for the help!

Posted: Fri Mar 31, 2006 2:17 pm
by Abacre
Go to main menu - Action - Options - Batch Replace
check "Modifier G"
check "Modifier I"

Go to Batch replace tab, check on "Use regular expressions".
Put into the grid, search for:
<img src=.*/(.+\.\w+.*)>

Replace with:
<img src=$1>

That's all I verified it works perfectly.

Posted: Fri Mar 31, 2006 2:50 pm
by Mr.Chaos
That's great! Thank you!