[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: delete non-matching lines
From: |
Pascal J. Bourguignon |
Subject: |
Re: delete non-matching lines |
Date: |
Tue, 11 Aug 2009 16:33:49 +0200 |
User-agent: |
Gnus/5.101 (Gnus v5.10.10) Emacs/22.2 (gnu/linux) |
Nachiket Gokhale <gokhalen@gmail.com> writes:
> How do I delete all lines starting with
>
> "ESPN"
M-x delete-matching-lines RET ^ESPN RET
>
> And, the opposite:
>
> How do I delete all lines not starting with
>
> "ESPN"
M-x delete-matching-lines RET ^\([^E C-q C-j ]\|E[^S C-q C-j ]\|ES[^P C-q C-j
]\|ESP[^N C-q C-j ]\) RET
Or perhaps just:
M-x delete-matching-lines RET ^\([^E]\|E[^S]\|ES[^P]\|ESP[^N]\) RET
if you are lucky.
You may also use:
C-x h M-| grep ESPN RET
or
C-x h M-| grep -v ESPN RET
but this is cheating.
--
__Pascal Bourguignon__