bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#6743: Backslash regexp in Elisp manual


From: Arni Magnusson
Subject: bug#6743: Backslash regexp in Elisp manual
Date: Wed, 28 Jul 2010 02:54:46 +0000 (GMT)
User-agent: Alpine 2.00 (LFD 1167 2008-08-23)

Sorry, my mistake. The sentence is correct in the manual.

Arni



On Wed, 28 Jul 2010, Juanma Barranquero wrote:

On Wed, Jul 28, 2010 at 01:31, Arni Magnusson <arnima@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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]