unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* replace-regexp question
@ 2003-06-02 11:21 Chang Luo
  2003-06-02 11:53 ` lawrence mitchell
  0 siblings, 1 reply; 12+ messages in thread
From: Chang Luo @ 2003-06-02 11:21 UTC (permalink / raw)


I want to replace regexp "a$" to "a$b$c$".  how to do that?

i.e.  I want:
a    ->     a
            b
            c

But replace-regexp gives me:
a   ->      a$b$c$

Thanks!

^ permalink raw reply	[flat|nested] 12+ messages in thread
* replace-regexp question
@ 2005-10-26 17:15 Neon Absentius
  0 siblings, 0 replies; 12+ messages in thread
From: Neon Absentius @ 2005-10-26 17:15 UTC (permalink / raw)


Is there a way to use the command replace-regexp to replace a number with 
that number increased, say, by 15?  I tried 

C-M-% -?[0-9]+ RET (number-to-string (+ (string-to-number "\&") 15)) RET

but it doesn't work because emacs interprets the second input to be a string 
and so it doesn't evaluate it.  So I guess the question is how can we use
the result of evaluating a sexp for replacement text?

Any help and/or pointers to documentation will be greatly appreciated. 

-- 
 There is no national science just as there is no national
multiplication table; what is national is no longer science.
         -- Anton Checov

^ permalink raw reply	[flat|nested] 12+ messages in thread
[parent not found: <mailman.12812.1130346970.20277.help-gnu-emacs@gnu.org>]

end of thread, other threads:[~2005-10-27 17:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-02 11:21 replace-regexp question Chang Luo
2003-06-02 11:53 ` lawrence mitchell
  -- strict thread matches above, loose matches on Subject: below --
2005-10-26 17:15 Neon Absentius
     [not found] <mailman.12812.1130346970.20277.help-gnu-emacs@gnu.org>
2005-10-26 17:34 ` David Kastrup
2005-10-26 18:24   ` Giorgos Keramidas
2005-10-26 19:52     ` David Kastrup
2005-10-27  9:01       ` Harald Hanche-Olsen
2005-10-27  9:32         ` David Kastrup
2005-10-27 11:47   ` Neon Absentius
2005-10-27 14:38   ` Sébastien Kirche
2005-10-27 15:08     ` David Kastrup
2005-10-27 17:24       ` Sébastien Kirche

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).