1

I wish to search for a block of code and then completely delete it. Is there a "remove" command or if I use "replace" to I need to leave the ![CDATA[]] in?

Here is the code I am using at the moment:

<operation error="log" info="Remove IP, Email, Telephone from top box">
        <search position="replace"><![CDATA[<td style="font-size: 12px; border-right: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD; text-align: left; padding: 7px;"><b><?php echo $text_email; ?></b><?php echo $email; ?><br />
    <b><?php echo $text_telephone; ?></b> <?php echo $telephone; ?><br />
    <b><?php echo $text_ip; ?></b> <?php echo $ip; ?><br /></td></search>
        <add></add>
    </operation>
flint781
  • 61
  • 1
  • 4

1 Answers1

0

Leaving the CDATA tags certainly won't hurt. But more importantly, multi-line searches like that are not supported in vQmod. To remove a block of code you should use the offset attribute in the <search> tag and include only the complete first line to search like this:

<operation>
    <search position="after" offset="2"><![CDATA[<td style="font-size: 12px; border-right: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD; text-align: left; padding: 7px;"><b><?php echo $text_email; ?></b><?php echo $email; ?><br />]]></search>
    <add><![CDATA[]]></add>
</operation>

This will match the line in the search tag as well as 2 additional lines specified by offset="2".