[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: RegExp: match everything except a certain string
From: |
Sven Utcke |
Subject: |
Re: RegExp: match everything except a certain string |
Date: |
28 Nov 2007 17:19:45 +0100 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 |
Sven Bretfeld <sven.bretfeld@gmx.ch> writes:
> Hello Andreas
>
> Andreas Röhler <andreas.roehler@online.de> 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)|___/|___|___/ |_|
Message not available