Wednesday, July 21, 2010

Re: Regex with logical not

On Jul 21, 4:57 pm, Chris Sutcliffe <ir0nh...@gmail.com> wrote:

> I'm trying to do a search in a file for all lines that do not contain
> an '@'

1) This regex isn't using a logical not, it positively search for
lines that
don't include that character.

^[^@]*$

2) Depending on your task, maybe you could use the :v command
to execute a command on all lines that don't match the pattern @

:help :v

3) For the more general case of inverting patterns, I think this
plugin
"LogiPat" from Dr Chip Campbell may do what you want.

http://www.vim.org/scripts/script.php?script_id=1290

regards,
Geoff

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: