From: Sven Utcke <utcke+news@informatik.uni-hamburg.de>
To: help-gnu-emacs@gnu.org
Subject: Re: RegExp: match everything except a certain string
Date: 28 Nov 2007 17:19:45 +0100 [thread overview]
Message-ID: <o2fzlwyxrz2.fsf@hasgksssven.desy.de> (raw)
In-Reply-To: mailman.3846.1195590989.18990.help-gnu-emacs@gnu.org
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)|___/|___|___/ |_|
next prev parent reply other threads:[~2007-11-28 16:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-20 16:08 RegExp: match everything except a certain string Sven Bretfeld
2007-11-20 17:50 ` Andreas Röhler
2007-11-20 20:36 ` Sven Bretfeld
2007-11-20 21:05 ` Lennart Borgman (gmail)
2007-11-20 21:31 ` Sven Bretfeld
[not found] ` <mailman.3846.1195590989.18990.help-gnu-emacs@gnu.org>
2007-11-28 16:19 ` Sven Utcke [this message]
2007-11-28 21:22 ` Malte Spiess
[not found] ` <mailman.3839.1195580948.18990.help-gnu-emacs@gnu.org>
2007-11-30 16:26 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=o2fzlwyxrz2.fsf@hasgksssven.desy.de \
--to=utcke+news@informatik.uni-hamburg.de \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.