unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Sven Bretfeld <sven.bretfeld@gmx.ch>
To: help-gnu-emacs@gnu.org
Subject: Re: Why are RegExps never working?
Date: Wed, 14 Nov 2007 00:51:27 +0100	[thread overview]
Message-ID: <87lk91so00.fsf@kamaloka.dhatu> (raw)
In-Reply-To: <20071113163749.GA3083@kobe.laptop> (Giorgos Keramidas's message of "Tue, 13 Nov 2007 18:37:49 +0200")


[-- Attachment #1.1: Type: text/plain, Size: 2077 bytes --]

Hi Peter and Giorgos

Giorgos Keramidas <keramida@ceid.upatras.gr> writes:

> On 2007-11-13 16:49, Peter Dyballa <Peter_Dyballa@Web.DE> 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

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 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

  reply	other threads:[~2007-11-13 23:51 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
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 [this message]
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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lk91so00.fsf@kamaloka.dhatu \
    --to=sven.bretfeld@gmx.ch \
    --cc=help-gnu-emacs@gnu.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).