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

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

Re: query-replace-regexp number number+1


From: David Kastrup
Subject: Re: query-replace-regexp number number+1
Date: Tue, 11 Apr 2006 21:05:07 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

"rturrado" <address@hidden> writes:

> I've tried that, but it complains with an "Invalid use of '\' in
> replacement text" error. I'm using GNU Emacs 21.3.1 on a SuSE bash.
> What's the "developer Emacs" version?

It announces itself as 22.0.something and has not yet been released.
Some people provide snapshots, though.  No idea whether there is
something for SuSE (Mandriva has one).  And one can, of course,
compile a copy oneself.

> Can I find a tutorial online explaining how to run commands/evaluate
> expressions/and so on within a regexp?

You could probably do

M-: (query-replace-regexp "\\([0-9]+\\)" '(replace-eval-replacement format "%d" 
(1+ (string-to-number (match-string 1))))) RET

But it is not exactly kosher.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum


reply via email to

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