On Oct 27, 1:06 pm, "Charles E. Campbell, Jr."
<[EMAIL PROTECTED]> wrote:
> Rafael Antognolli wrote:
> > Hi,
>
> > I'm trying to use the matchadd() command, but I want to highlight some
> > lines that match my regular expression only when they don't match
> > another regular expression.
>
> > Is there a way to do that?
>
> I suggest looking into LogiPat; you can get the latest LogiPat.vim from
>
>    http://mysite.verizon.net/astronaut/vim/index.html#LOGIPAT   
> (cutting edge)
>    http://vim.sourceforge.net/scripts/script.php?script_id=1290  (stable)
>
>     :LogiPat "abc"
>         will search for lines containing the string "abc"
>
>     :LogiPat !"abc"
>         will search for lines which don't contain the string "abc"
>
>     :LogiPat "abc"|"def"
>         will search for lines which contain either the string
>         "abc" or the string "def"
>
>     :LogiPat !("abc"|"def")
>         will search for lines which don't contain either
>         of the strings "abc" or "def"
>
>     :LogiPat "abc"&"def"
>         will search for lines which contain both of the strings
>         "abc" and "def"
>
>     :let pat= LogiPat('!"abc"')
>         will return the regular expression which will match
>         all lines not containing "abc".  The double quotes
>         are needed to pass normal patterns to LogiPat, and
>         differentiate such patterns from boolean logic
>         operators.
>
> Regards,
> Chip Campbell

Though it is certainly also possible to build the pattern yourself!

Without knowing exactly what you want to search for, I can't build it
for you, but helpful things for this might include:

:help /\bar
:help /\branch
:help /[EMAIL PROTECTED]
:help /\@<!
:help /\(
:help /\%(
:help /\zs
:help /\ze

You almost certainly won't need all of these, but with them you'll
certainly be able to do what you want here.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to