From: Peter Dyballa <Peter_Dyballa@Web.DE>
To: Sven Bretfeld <sven.bretfeld@gmx.ch>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Why are RegExps never working?
Date: Sun, 11 Nov 2007 15:47:52 +0100 [thread overview]
Message-ID: <D225E1C5-9A45-4931-AB0C-6E54B2C9EE65@Web.DE> (raw)
In-Reply-To: <87lk94oozv.fsf@kamaloka.dhatu>
[-- Attachment #1.1: Type: text/plain, Size: 1103 bytes --]
Am 11.11.2007 um 15:06 schrieb Sven Bretfeld:
> pp\.[ \|$][0-9]
>
> To my understanding, it should mean: the string pp. followed by a
> group consisting of space or end-of-line followed by a number.
>
> ...
>
> What's my mistake?
You mean: what *are* ?
Everything between square brackets, i.e. in [], are alternatives, no
| is needed.
What you are trying to search and destroy, ahhem, replace are not
line endings but line feeds inside the from expression. These are put
into the expression as C-q C-j. The expression between [] won't look
like such, but I can give you some guarantee: it works! Definitely.
And please read again what a "group" in regular expressions is! The ``
[ \|$]´´ and the ``[0-9]´´ are bracket expressions, a faulty (for
your purpose) and a working one. If you want to re-use parts of the
search expression you can use:
\(pp\.\)[ ^J]\([0-9]\) -> \1~\2
Line feed or SPC are converted to ~.
--
Mit friedvollen Grüßen
Pete
Well done is better than well said.
-- Benjamin Franklin
[-- Attachment #1.2: Signierter Teil der Nachricht --]
[-- Type: application/pgp-signature, Size: 194 bytes --]
[-- Attachment #2: Type: text/plain, Size: 152 bytes --]
_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
next prev parent reply other threads:[~2007-11-11 14:47 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-11 14:06 Why are RegExps never working? Sven Bretfeld
2007-11-11 14:47 ` Peter Dyballa [this message]
2007-11-11 15:19 ` Sven Bretfeld
2007-11-11 15:52 ` Peter Dyballa
2007-11-11 23:24 ` Sven Bretfeld
2007-11-12 9:39 ` Peter Dyballa
2007-11-12 9:53 ` Sven Bretfeld
[not found] ` <mailman.3307.1194823515.18990.help-gnu-emacs@gnu.org>
2007-11-12 8:21 ` Harald Hanche-Olsen
2007-11-12 9:55 ` Sven Bretfeld
2007-11-12 10:15 ` Lennart Borgman (gmail)
2007-11-12 15:10 ` Drew Adams
2007-11-12 16:01 ` Sven Bretfeld
[not found] ` <mailman.3326.1194861370.18990.help-gnu-emacs@gnu.org>
2007-11-12 13:04 ` Richard G Riley
2007-11-12 18:54 ` Drew Adams
2007-11-13 8:55 ` Tim X
2007-11-13 13:54 ` Richard G Riley
[not found] ` <mailman.3268.1194797266.18990.help-gnu-emacs@gnu.org>
2007-11-12 23:53 ` Giorgos Keramidas
2007-11-13 15:49 ` Peter Dyballa
2007-11-13 16:37 ` Giorgos Keramidas
2007-11-13 23:51 ` Sven Bretfeld
2007-11-14 9:55 ` Peter Dyballa
2007-11-14 17:52 ` Sven Bretfeld
[not found] ` <mailman.3482.1194997914.18990.help-gnu-emacs@gnu.org>
2007-11-14 3:13 ` Giorgos Keramidas
2007-11-14 9:22 ` Johan Bockgård
2007-11-16 5:15 ` Tim X
2007-11-16 10:17 ` Johan Bockgård
2007-11-11 15:21 ` Bastien
2007-11-11 14:38 ` Sven Bretfeld
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=D225E1C5-9A45-4931-AB0C-6E54B2C9EE65@Web.DE \
--to=peter_dyballa@web.de \
--cc=help-gnu-emacs@gnu.org \
--cc=sven.bretfeld@gmx.ch \
/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.