Friday, January 25, 2013

Re: does vi has a funtion like "grep -v"?

skyworld wrote:
> Hi,
>
> does vi has a fuction like "grep -v"? I always found I need to seach
> within the file with those lines which exclue specific strings.
> Thanks.
>
Here are two methods:

:v/pattern/p

/^\%(\%(pattern\)\@!.\)*$

You may find LogiPat of interest; it allows you to construct patterns
using Boolean logic (not, and, or):
http://www.drchip.org/astronaut/vim/index.html#LOGIPAT

Regards,
C Campbell

--
--
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: