Page 1 of 1

replace code

Posted: Fri Sep 15, 2006 8:38 pm
by miksas

I have a bunch of html files

I want to specify some text as beginning and some text as end eg 'start' and 'end'

now I want to remove/delete, both start and end and everything included

but please note that 'start' and 'end' maybe text, in many lines, not one line

can you help me please?


Posted: Fri Sep 15, 2006 9:12 pm
by Abacre
You should use regular expressions.

Go to main menu - Action - Options - Batch Replace
check "Modifier S"
uncheck "Modifier G"

Go to Batch replace tab, check on "Use regular expressions".
Put into the grid, search for:

Replace with should be empty.

Note that .* means any number of any chars.

Note: if start or end contains any reserved chars like:
.,\[] etc
you should escape it with \

For example, start is font.color
so you should use font\.color

Posted: Fri Sep 15, 2006 10:08 pm
by miksas
thanks but 'start' and 'end' is text in multiple lines, how can I do start.*end ?

eg start:

Code: Select all


Posted: Sat Sep 16, 2006 7:43 am
by Abacre
\r\n is end of line.
So use the following:

Code: Select all

</a></td>\r\n</tr></table>\r\n    </td></tr>