Page 1 of 1

Need help on Batch 2 (find/replace)

Posted: Mon Jul 21, 2014 3:33 pm
by D1Knauer
The standard "find and replace" is no problem.
However, when I tried to do it with a Batch file and a more complicated string search, it doesn't work.
The task should be:

Find in a *.html-file segment an expression that begins with:
<div id="nav">
...and ends with:
</div> <!--end tag nav!-->
...or should it be the whole code between?

then, replace it with:
<!--#include virtual="includes/navigation_tr-intern.inc" -->

It is a typical action to use SSI in a WEB page instead of the whole code.
It would be nice, if somebody would help me make it run.

Thanx
Dieter

Re: Need help on Batch 2 (find/replace)

Posted: Thu Jul 31, 2014 12:18 pm
by DigitalVolcano
This should do it (Regular expression mode, with 'Dot matches newline' checked)

Regex:
<div id="nav">.*?</div> <!--end tag nav!-->


Replace:
<!--#include virtual="includes/navigation_tr-intern.inc" -->

Re: Need help on Batch 2 (find/replace)

Posted: Thu Jul 31, 2014 4:07 pm
by D1Knauer
That's it. I guess it should be easy - but you have to know it.
Thanks a lot!
Dieter