[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Searching for >> not >>>
In message <00eca61f-7791-7ee8-17b4-079e7e35e5fa@xxxxxxxxxxx>
Steve Drain <steve@xxxxxxxxxxx> wrote:
> On 14/02/2020 09:54, Martin wrote:
> > I am sure this should be simple ... but how do I search for instances
> > of ">>" but I do not want ">>>" to be included?
> >
> > Everything I have tried includes instances of the two characters,
> > even if they were preceeded by the third!
>
> In a simple test this worked: ">>"~">"
Yes, that's what came to my mind first too, but it doesn't do what I
think Martin is after. Which is to match ">>" on its own not as part of
">>>". The above expression won't match the first two ">" but it will
match the last two.
If that is indeed what Martin wants then it's actually quite a tricky
one to get right. 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
Cheers,
Fred.
PS Martin, I will get back to you on testing colour printing but I've
let myself get horribly sidetracked with adding desktop font plotting.
--
StrongED Developer
http://www.stronged.iconbar.com/