From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sven Bretfeld Newsgroups: gmane.emacs.help Subject: Re: Why are RegExps never working? Date: Wed, 14 Nov 2007 00:51:27 +0100 Message-ID: <87lk91so00.fsf@kamaloka.dhatu> References: <87lk94oozv.fsf@kamaloka.dhatu> <87abpkolme.fsf@kamaloka.dhatu> <873avbyq9l.fsf@kobe.laptop> <3A73B20F-E3D8-40F1-B292-9389A351ECAF@Web.DE> <20071113163749.GA3083@kobe.laptop> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0342151218==" X-Trace: ger.gmane.org 1194997940 28439 80.91.229.12 (13 Nov 2007 23:52:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 13 Nov 2007 23:52:20 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 14 00:52:22 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 1Is5YM-0006vC-73 for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Nov 2007 00:52:22 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Is5Y9-0006M6-Fr for geh-help-gnu-emacs@m.gmane.org; Tue, 13 Nov 2007 18:52:09 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Is5Xt-0006Lx-3P for help-gnu-emacs@gnu.org; Tue, 13 Nov 2007 18:51:53 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Is5Xq-0006LD-MA for help-gnu-emacs@gnu.org; Tue, 13 Nov 2007 18:51:52 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Is5Xq-0006LA-F5 for help-gnu-emacs@gnu.org; Tue, 13 Nov 2007 18:51:50 -0500 Original-Received: from viefep27-int.chello.at ([62.179.121.47]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Is5Xp-0006SF-Rs for help-gnu-emacs@gnu.org; Tue, 13 Nov 2007 18:51:50 -0500 Original-Received: from kamaloka.dhatu ([80.219.162.86]) by viefep27-int.chello.at (InterMail vM.7.08.02.02 201-2186-121-104-20070414) with ESMTP id <20071113235147.GEKM9364.viefep27-int.chello.at@kamaloka.dhatu> for ; Wed, 14 Nov 2007 00:51:47 +0100 In-Reply-To: <20071113163749.GA3083@kobe.laptop> (Giorgos Keramidas's message of "Tue, 13 Nov 2007 18:37:49 +0200") User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1.50 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Solaris 10 (beta) 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:49224 Archived-At: --===============0342151218== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --=-=-= Hi Peter and Giorgos Giorgos Keramidas writes: > On 2007-11-13 16:49, Peter Dyballa wrote: >> >> Am 13.11.2007 um 00:53 schrieb Giorgos Keramidas: >> >>> \([[:space:]][pP][pP]\.\)[[:space:]]+\([0-9]+\) -> \1~\2 >> >> Did you try it? For me it does correct Sven's example, which is this: >> >> text pp. 44 text text text text text text text text pp. >> 54 text >> >> It would work when the from part would not stretch over more than one line. > > I did. > > I used an Emacs snapshot from CVS, but I have this sort of regexp in my > ~/NOTES file for several years. The last time I updated the note was on > May 15, 2004. It is strange that it doesn't work there. > > I just tried once more, by running: > > emacs -q -nw > > Then I pasted in a text-mode buffer the text: > > text pp. 44 text text text text text text text text pp. > 54 text > > and after replacing the regexp shown above, my buffer now contains: > > text pp.~44 text text text text text text text text pp.~54 text > > Odd, indeed... It's partly working. But not with all major modes. It's working in a Fundamental buffer, but neither in the *scratch* nor in an AucTeX buffer. How Emacs is started doesn't seem to matter. That disturbs me. Line endings should be \n in every mode, aren't they? The info node Char Classes says: `[:space:]' This matches any character that has whitespace syntax (*note Syntax Class Table::). While a whitespace character is described thus: -- Syntax class: whitespace character "Whitespace characters" (designated by ` ' or `-') separate symbols and words from each other. Typically, whitespace characters have no other syntactic significance, and multiple whitespace characters are syntactically equivalent to a single one. Space, tab, newline and formfeed are classified as whitespace in almost all major modes. ^^^^^^^^^^^^^^^^^^^^^^^^^ Obviously not in the LaTeX major mode. It's a pity. Would have been a nice shortcut. Greetings Sven --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFHOjiEV5JTHLAduAYRAjn/AJ0V6gB4RFtB4hYdV12hXHYc7Qn2awCfc/B7 5hQn1hOEUomlcqfQ/3CM0cI= =Rqpx -----END PGP SIGNATURE----- --=-=-=-- --===============0342151218== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ help-gnu-emacs mailing list help-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-emacs --===============0342151218==--