In Vim, is there a way to search for lines that match say abc
but do not also contain xyz
later on the line? So the following lines would match:
I think I'd write this as /abc\(\(xyz\)\@!.\)*$
I'm not sure whether this is faster than other suggestions (I think it might be since it tests each position only once) but it makes conceptual sense as:
"abc followed by anything which is not xyz, any number of times until end of line"
I like that better than "abc followed by anything not followed by xyz" as in the other patterns mentioned.