help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grep can help?


From: Glenn Morris
Subject: Re: grep can help?
Date: Wed, 21 Apr 2004 16:09:25 +0100
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

FCC wrote:

> Initially I was trying to use isearch for a regexp but only to
> search for those occurences which are not in comments (or which do
> not appear after the character !). After spending some time with
> Google, it turned out that this is not possible because one cannot
> "invert a match", which is what is required here.

M-x occur ^[^!C-qC-j]*regexp

ought to work (the C-qC-j bit gives you a newline).
It will be fooled by instances of your desired regexp occurring after
a string containing !, but I imagine that's unlikely. If you needed
to deal with that, you could cook up some elisp using f90-in-comment.

> Then came the idea to use grep.

I guess comp.unix.shell or somesuch place is the right place for grep
questions.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]