From: "Andreas Röhler" <andreas.roehler@online.de>
To: help-gnu-emacs@gnu.org
Subject: Re: RegExp: match everything except a certain string
Date: Tue, 20 Nov 2007 18:50:02 +0100 [thread overview]
Message-ID: <200711201850.02854.andreas.roehler@online.de> (raw)
In-Reply-To: <87fxz0j3wc.fsf@kamaloka.dhatu>
Am Dienstag, 20. November 2007 17:08 schrieb Sven Bretfeld:
> Hello to all
>
> A RegExp beginner's question again. I cannot find a way to search for
> a regexp that matches everything except of one certain string. The
> problem is:
>
> 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:
>
> ^ \<[^s].* = {},*
>
> But this one also excludes the "series line", of course. I was
> thinking of \<[^s][^u] but this doesn't work, since, then, the initial
> s of "subtitle" is matched again.
>
> What is the syntax for find .* except of the string "subtitle"? I
> didn't recognize this in the Lisp info.
>
> Thanks for help
>
> Sven
Got it with:
[^s]?[^u]?[^b]?[^t]?[^i]?[^t]?[^l]?[^e] = {},?$
Please don't ask why :)
Anyway--you will know that and it's not the precise
answer-- it might be useful to point at
M-x shell-command-on-region
grep {} | sed /subtitle/d
as an easy-to-use solution.
Andreas Röhler
next prev parent reply other threads:[~2007-11-20 17:50 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 [this message]
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
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200711201850.02854.andreas.roehler@online.de \
--to=andreas.roehler@online.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).