Page 1 of 1

Complex replacing

Posted: Sun Oct 31, 2010 10:15 pm
by Rikardov
Hi, I hope you can help me with this, I'm having a hard time doing it as I'm new to regular expressions

I have thousands of these lines, each with a different file name of course.

Code: Select all

<image imageURL="images/FILENAMEXX.jpg" thumbURL="thumbs/FILENAMEXX.jpg" 

linkURL="" linkTarget="" >
	
And I need them to look like this:

Code: Select all

<image>
	<filename>FILENAMEXX.jpg</filename>
	
I've tried everything and read a lot about regular expression but I'm nowhere near the result I need, I really hope you can help me with it, thank you very much.

Posted: Sun Oct 31, 2010 11:05 pm
by ak47wong
Find what: <image imageURL="images/([^"]*).*
Replace with: <image>\n___<filename>\1</filename> (replace 3 underscores with 3 spaces)

This assumes you have POSIX regular expression syntax enabled in Configure->Preferences->Editor.