GNU bug report logs - #6743
Backslash regexp in Elisp manual

Previous Next

Package: emacs;

Reported by: Arni Magnusson <arnima <at> hafro.is>

Date: Tue, 27 Jul 2010 23:33:01 UTC

Severity: normal

Done: Juanma Barranquero <lekktu <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 6743 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Arni Magnusson <arnima <at> hafro.is>
Cc: 6743 <at> debbugs.gnu.org
Subject: Re: bug#6743: Backslash regexp in Elisp manual
Date: Wed, 28 Jul 2010 02:25:35 +0200
On Wed, Jul 28, 2010 at 01:31, Arni Magnusson <arnima <at> hafro.is> wrote:

>  Therefore, the read syntax for a regular expression matching
>  @samp{\} is @code{"\\\\"}.
>
> should be
>
>  Therefore, the read syntax for a regular expression matching
>  @samp{\\} is @code{"\\\\"}.

Why do you think so?

The section is talking about the read syntax. To match \, you need a
regexp with \\, and to write \\ in a string, you need \\\\.

Try

  emacs -Q
  \ <left>
  M-: (looking-at "\\") <RET>   => (invalid-regexp "Trailing backslash")
  q
  M-: (looking-at "\\\\") <RET> => t

Note that \\\\ is matching a single \ on the buffer, not \\

    Juanma




This bug report was last modified 14 years and 301 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.