From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sven Utcke Newsgroups: gmane.emacs.help Subject: Re: RegExp: match everything except a certain string Date: 28 Nov 2007 17:19:45 +0100 Organization: Deutsches Elektronen-Synchrotron (DESY) Message-ID: References: <87fxz0j3wc.fsf@kamaloka.dhatu> <200711201850.02854.andreas.roehler@online.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1196268145 31488 80.91.229.12 (28 Nov 2007 16:42:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 28 Nov 2007 16:42:25 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 28 17:42:32 2007 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 1IxPza-0000MH-1l for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Nov 2007 17:42:30 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IxPzK-0002K3-IF for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Nov 2007 11:42:14 -0500 Original-Path: shelby.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!t-online.de!news-lei1.dfn.de!news-ham1.dfn.de!claire.desy.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 40 Original-NNTP-Posting-Host: hasgksssven.desy.de User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Original-Xref: shelby.stanford.edu gnu.emacs.help:154219 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:49647 Archived-At: Sven Bretfeld writes: > Hello Andreas > > Andreas Röhler writes: > > >> author = {somename}, > >> editor = {}, > >> title = {sometitle}, > >> subtitle = {}, > >> series = {}, > >> url = {} > >> > >> I want to find a regexp that matches every line with empty {} except > >> of the "subtitle line". I've come that far: > >> > > Got it with: > > > > [^s]?[^u]?[^b]?[^t]?[^i]?[^t]?[^l]?[^e] = {},?$ > > > > Please don't ask why :) > > That's working. Thanks. (I don't ask.) I haven't followed the original thread, so I might be way of the mark here, but the above would of course not find "title = {}" either (as well as quite a few less likely variations). If using external programs is an option, grep '\{\}' | grep -v subtitle would do what you are looking for... Sven -- ___ _ _____ ___ Dr.-Ing. Sven Utcke ___ ___ _____ __ / __| |/ / __| __| phone: +49 40 8998-5317 | \| __/ __\ \ / / | (_ | ' <\__ \__ \ fax : +49 40 8994-5317 (NEW) | |) | _|\__ \\ V / \___|_|\_\___|___/ http://www.desy.de/~utcke (to come)|___/|___|___/ |_|