[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
- Re: Why are RegExps never working?, (continued)
- Re: Why are RegExps never working?, Sven Bretfeld, 2007/11/12
- Message not available
- Re: Why are RegExps never working?, Harald Hanche-Olsen, 2007/11/12
- Re: Why are RegExps never working?, Sven Bretfeld, 2007/11/12
- Re: Why are RegExps never working?, Lennart Borgman (gmail), 2007/11/12
- RE: Why are RegExps never working?, Drew Adams, 2007/11/12
- Re: Why are RegExps never working?, Sven Bretfeld, 2007/11/12
- Message not available
- Re: Why are RegExps never working?, Richard G Riley, 2007/11/12
- RE: Why are RegExps never working?, Drew Adams, 2007/11/12
- Re: Why are RegExps never working?, Tim X, 2007/11/13
- Re: Why are RegExps never working?, Richard G Riley, 2007/11/13
- Message not available
- Re: Why are RegExps never working?,
Giorgos Keramidas <=
- Re: Why are RegExps never working?, Peter Dyballa, 2007/11/13
- Re: Why are RegExps never working?, Giorgos Keramidas, 2007/11/13
- Re: Why are RegExps never working?, Sven Bretfeld, 2007/11/13
- Re: Why are RegExps never working?, Peter Dyballa, 2007/11/14
- Re: Why are RegExps never working?, Sven Bretfeld, 2007/11/14
- Message not available
- Re: Why are RegExps never working?, Giorgos Keramidas, 2007/11/14
- Re: Why are RegExps never working?, Johan Bockgård, 2007/11/14
- Re: Why are RegExps never working?, Tim X, 2007/11/16
- Re: Why are RegExps never working?, Johan Bockgård, 2007/11/16