help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why are RegExps never working?


From: Giorgos Keramidas
Subject: Re: Why are RegExps never working?
Date: Tue, 13 Nov 2007 01:53:42 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (berkeley-unix)

On Sun, 11 Nov 2007 16:52:04 +0100, Peter Dyballa <Peter_Dyballa@Web.DE> wrote:
>Am 11.11.2007 um 16:19 schrieb Sven Bretfeld:
>> This works perfectly (of course). I will search in the info
>> for the difference between a line feed and an end of line,
>> which is not clear to me.
>
> I'm not sure whether it's described so clearly. The main thing
> is that text is line oriented and therefore $ states end of
> line. [...]

There's a minor 'catch' here, which may prove interesting.  The
`character-classes' supported by the regexp engine of Emacs
consider the end of a line a [[:space:]] character, so you can do
replacements like:

    \([[:space:]][pP][pP]\.\)[[:space:]]+\([0-9]+\) -> \1~\2

This will DTRT, as far as the original poster's question is
concerned, but it may `join' some lines in the process.  A bit of
fill-paragraph can fix that too, and you are ready to go :-)

- Giorgos


reply via email to

[Prev in Thread] Current Thread [Next in Thread]