From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.help Subject: Re: grep can help? Date: Wed, 21 Apr 2004 16:09:25 +0100 Organization: None Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1082561031 27220 80.91.224.253 (21 Apr 2004 15:23:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 21 Apr 2004 15:23:51 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 21 17:23:43 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BGJZf-0000gI-00 for ; Wed, 21 Apr 2004 17:23:43 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BGJSJ-0007PW-6X for geh-help-gnu-emacs@m.gmane.org; Wed, 21 Apr 2004 11:16:07 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!feed3.jnfs.ja.net!jnfs.ja.net!pegasus.csx.cam.ac.uk!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 19 Original-NNTP-Posting-Host: xpc14.ast.cam.ac.uk X-Spook: FRETILIN mercury fulminate subsonic Berlin PCP HAMAS bomb X-Attribution: GM Mail-Copies-To: nobody User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) Cancel-Lock: sha1:FaO/vFcUAwuigfW5et0dTbWbfe4= Original-Xref: shelby.stanford.edu gnu.emacs.help:122532 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:17819 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:17819 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.