I appreciate the ideas, but my goal is to not make any changes that are not needed, and to not make errors that have to
be fixed. Some of my processes run over 5 minutes, depending on the size of the input file, so not making any changes
that are unneeded, and not having to fix errors saves processing time. At some point, I need to find out which processes
are taking the most time, and see if I can find ways to speed them up.
But if I WAS to use the cleanup feature you described, I'd do it this way:
^!Replace "^<<>>(S>\x20)\K\1" >> "" ARSW
RecipeTools Web Site: <http://recipetools.gotdns.com/
] On Behalf Of Axel Berger
Sent: Tuesday, May 29, 2012 09:26
Subject: Re: [Clip] Assertion behavior - was - RE: [NTS] Can a Reg Exp handle 123 AND not a|b|c followed by x?
John Shotsky wrote:
> In the past, I've simply used the (S>\x20)? at the beginning,
> which has the effect of replacing them even if they are present.
As expected what you get from me is a primitive solution. What I
frequently do in cases like this is insert the string regardless and the
replace it with nothing, if it's double.
This repairs unescaped ampersands in URLs:
This comments or uncomments HTML:
^!InsertSelect <!-- ^P^$GetSelection$-->^P
^!Replace "<!-- ^P<!-- ^P" >> "" HASTI
^!Replace "-->^P-->^P" >> "" HASTI
In all cases where the wrong thing is easy to find and easy to undo I
don't put effort into doing the right thing only. So why not
^!Replace "^P<<>>S>S>" >> "^P<<>>S>" WASTI
[Non-text portions of this message have been removed]