[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Searching for >> not >>>



In message <5842397acdlist01@xxxxxxxxxxxxxxxx>
          Martin <list01@xxxxxxxxxxxxxxxx> wrote:

>> The best I've come up with so far is:
>
>>  < | ( ~">" .) @0 ">>" ~">"
>
>> This breaks down into:
>
>>  < | (~">" .) if at start-of-line, or if first character isn't ">"
>>               then match it (to advance search pointer)
>
>>  @0           actual match starts here, so preceding not coloured
>>               in LoF
>
>>  ">>"         literal string to match
>
>>  ~">"         next character should not be ">" for match to succeed
>
>Yes, I can confirm that does exactly what I want.

Does it match a line ending with >>? The StrongED Help on ~
says

    "A" ~ "B"  : Matches "A" if the following character is not "B"

but it does not say what happens if there is no next character, and
this makes it incomplete. It would make pattern syntax a lot easier if
it counted "beginning of string" and "end of string" as characters.
Using ^ and $ as these pseudocharacters what we want is

  (^ or not >) >> ($ or not >)



--
Gavin Wraith (gavin@xxxxxxxxxxxxxxx)
Home page: http://www.wra1th.plus.com/