Primary Navigation

Secondary Navigation

18988Re: [Clip] Re: Using regex to insert a comment

Expand Messages

Don - HtmlFixIt.com

Mar 4, 2009

Um yes Flo, can you break that down for the slow kids in the back here?

paulmaser wrote:

> Flo;
> Once again, your regex is beyond my ability to comprehend and I will have to dive into the manual to understand what you are doing. It looks like it gives me exactly what I needed. Using the clipboard to store is pretty nifty. Your use of \K is really inovative.
> Thanks again;
> Paul
>
>> When running the following clip on these lines...
>>
>>
>> ^!SetScreenUpdate Off
>> ^!SetWordWrap Off
>> ^!Jump Doc_Start
>> :Start
>> ^!Find "(?s)^<!--[^-]+-->\x20\r\n<li>.+?((?=^<!)|\Z)" RS
>> ^!IfError End
>> ; Long line start
>> ^!SetClipboard ^$GetDocMatchAll("^<\!--\x20\K([^-]+)(?=-->\x20\r\n<li>)")$
>> ; Long line end
>> ^!Replace "(<li>)(<b>)" >> "$1^$GetClipboard$$2" HARS
>> ^!Jump Select_End
>> ^!If ^$GetRow$=^$GetTextLineCount$ End
>> ^!Goto Start
>