From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Giorgos Keramidas Newsgroups: gmane.emacs.help Subject: Re: Why are RegExps never working? Date: Tue, 13 Nov 2007 01:53:42 +0200 Organization: SunSITE.dk - Supporting Open source Message-ID: <873avbyq9l.fsf@kobe.laptop> References: <87lk94oozv.fsf@kamaloka.dhatu> <87abpkolme.fsf@kamaloka.dhatu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1194961272 27732 80.91.229.12 (13 Nov 2007 13:41:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 13 Nov 2007 13:41:12 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Nov 13 14:41:17 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Irw0u-0007Ru-Fd for geh-help-gnu-emacs@m.gmane.org; Tue, 13 Nov 2007 14:41:12 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Irw0i-0004Sc-1b for geh-help-gnu-emacs@m.gmane.org; Tue, 13 Nov 2007 08:41:00 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed1.swip.net!swipnet!newsfeed.sunet.se!news01.sunet.se!news.net.uni-c.dk!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (berkeley-unix) Cancel-Lock: sha1:531osLDTAG69s+1nMUO8H5df0x8= Original-Lines: 22 Original-NNTP-Posting-Host: 81.186.70.182 Original-X-Trace: news.sunsite.dk DXC==5HIG:aoP2mE406ddB4h2jYSB=nbEKnkkf2; 89Q0P2=bL^MjgX7f^UIZ@YZi=\MjUlc9aQm9G=; X6k Original-X-Complaints-To: staff@sunsite.dk Original-Xref: shelby.stanford.edu gnu.emacs.help:153764 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:49210 Archived-At: On Sun, 11 Nov 2007 16:52:04 +0100, Peter Dyballa 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