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

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

Re: replace-match and backslashes


From: Andreas Schwab
Subject: Re: replace-match and backslashes
Date: 17 Apr 2001 13:09:28 +0200
User-agent: Gnus/5.090002 (Oort Gnus v0.02) Emacs/21.0.103

alex@gnu.org (Alex Schroeder) writes:

|> In GNU Emacs 20.7.1 (i686-pc-linux-gnu, X toolkit)
|>  of Sun Apr  8 2001 on snail
|> 
|> 
|> When evaluating either of the following two expressions, I get the
|> error "Invalid use of `\' in replacement text", eventhough "\\" is
|> documented as "`\\' stands for a single `\' in the replacement text."
|> 
|> This is either a bug in the documentation or a bug in replace-match.

Neither.  Please note that there are two layers of quoting, once on lisp
level and once on regex level.

|> This is supposed to return "--\--":

"--\--" is the same as "----" on the lisp level.

|> The following works -- the expression returns "--\\--".

Which is exactly what you want.

Andreas.

-- 
Andreas Schwab                                  "And now for something
SuSE Labs                                        completely different."
Andreas.Schwab@suse.de
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5



reply via email to

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