Topic: XML serach & replace (1 of 2), Read 53 times
Conf: Search and Replace
From: Chris Tammes
Date: Monday, August 02, 2004 04:04 AM

Hi,

I am trying to correct a XML file and replace double quotes, less than signs and ampersands.
I want to search for any '&' sign not followed by 'quot', 'lt' and 'amp' and want to replace it with '&'.
I tried with searchpattern '{&}{[^q]}', replacepattern '\1amp;\2' and this works, but only for the '"' text.
How can I add the other two searchstrings in the same searchpattern?

 


Topic: XML serach & replace (2 of 2), Read 69 times
Conf: Search and Replace
From: Christian Ziemski
Date: Monday, August 02, 2004 05:57 AM

On 8/2/2004 4:04:55 AM, Chris Tammes wrote:
>
>I am trying to correct a XML file and replace double
>quotes, less than signs and ampersands.
>I want to search for any '&' sign not followed by 'quot',
>'lt' and 'amp' and want to replace it with '&'.
>I tried with searchpattern '{&}{[^q]}', replacepattern
>'\1amp;\2' and this works, but only for the '"' text.
>How can I add the other two searchstrings in the same
>searchpattern?

I doubt that it's possible within one search string.

But with this short "macro" it works:

BoF
repeat(ALL) {
Search("&|!|{amp,lt,quot}", NOERR+ERRBREAK)
Char(1)
Ins_Text("amp;")
}


Christian