From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Anselm Helbig Newsgroups: gmane.emacs.help Subject: Re: regular expression for hiding comment Date: Thu, 07 May 2009 16:19:43 +0200 Organization: Freie Universitaet Berlin Message-ID: <87bpq5j8qo.wl%anselm.helbig+news2009@googlemail.com> References: <81a6e898-481c-4b04-bc88-af95ad089e8e@j12g2000vbl.googlegroups.com> <7cocu53ylo.fsf@pbourguignon.anevia.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1241707253 24585 80.91.229.12 (7 May 2009 14:40:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 7 May 2009 14:40:53 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu May 07 16:40:43 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1M24mB-0003UD-7a for geh-help-gnu-emacs@m.gmane.org; Thu, 07 May 2009 16:40:43 +0200 Original-Received: from localhost ([127.0.0.1]:56958 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M24mA-0002Dn-JV for geh-help-gnu-emacs@m.gmane.org; Thu, 07 May 2009 10:40:42 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 24 Original-X-Trace: news.uni-berlin.de pFqkcb/4aGxt8gHpQTNaHwxte3U1ucgX6ELgTDim8yHu6G86G3y4k4q6E8 Cancel-Lock: sha1:Wkejv/RR5YeAtXcBXCB2r92k7MU= In-Reply-To: Mail-Followup-To: anselm.helbig+news2009@googlemail.com User-Agent: SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.7 Emacs/22.3 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI) Original-Xref: news.stanford.edu gnu.emacs.help:168958 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:64227 Archived-At: Hi! > I need a regexp which show all line execpt lines which include the > string "--" (the qoute is not part of the sign). Generally, RegExps suck at "negative matching". You'd rather have a regexp match all lines that are comments and then do something to the other lines. There's M-x flush-lines for example, and M-x grep calls out to the external grep program that has the `-v'-switch. It might be possible to construct a regex that does what you want. Unfortunately, this isn't so easy and Peter's solution is definitely wrong - it matches any line that contains two adjacent non-dash characters. I don't have a quick answer to that one neither - nice brain teaser. 8-) HTH, Anselm -- Anselm Helbig mailto:anselm.helbig+news2009@googlemail.com