I need to match lines using g// (not v//); those lines having 'foo' and NOT having /)\s*;/ anywhere in the line. How do I
write such regex.

Well, there are several ways to go about it.  One would be to use
Dr. Chip's "logipat" script:

http://vim.sourceforge.net/scripts/script.php?script_id=1290

Another would be to use something like

:g/foo/if getline(".")!~'blah' | print getline(".") | endif


which would search for lines that do contain "foo", but don't
contain "blah".

I don't know about using the \& atom.  There might be a solution
with that as well, but for negating matters, it becomes trickier.

-tim



Reply via email to