Exclusive repeat match
This was raised as a problem in the mailing list. The requirement was to match >> and to exclude >>>. Most solutions would find the first two chevrons, or the last two, so in both cases >>> would be found. The actual character matched is unimportant: we will use x to denote it, but remember that certain characters must be escaped in text strings.
Search ( ~"x" .) @0 "xx" ~"x"
This breaks down to
(~"x" .) if first character isn't "x" then match it (to advance the search pointer)
@0 set mark @0 so that the actual match starts here and the preceding character is not coloured in LoF
"xx" literal string to match
next character should not be "x" for match to succeed
Was this page helpful? Please email me and/or rate this page:
If you want a reply make sure any email address @torrens.org will not get spam-binned!