|
From: | Tino Calancha |
Subject: | Re: query-replace-regexp: Can't use \0 in TO-STRING |
Date: | Sat, 6 May 2017 14:04:46 +0900 (JST) |
User-agent: | Alpine 2.20 (DEB 67 2015-01-07) |
On Sat, 6 May 2017, zhanghj wrote:
The doc says: In TO-STRING, ‘\&’ or ‘\0’ stands for whatever matched the whole of REGEXP, and ‘\N’ (where N is a digit) stands for whatever matched the Nth ‘\(...\)’ (1-based) in REGEXP. The ‘\(...\)’ groups are counted from 1. But when using \0, emacs gives the following error message: match-substitute-replacement: Invalid use of ‘\’ in replacement text Using \& is OK.
Thanks. The docstring for `query-replace-regexp' was updated in commit 38f4b8ea615 to fix Bug#23884. Apparently, \0 has never referred to the whole match in this command(\& it does), so we might want to skip \0 from this docstring and the manual.
Regards, Tino
[Prev in Thread] | Current Thread | [Next in Thread] |