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

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

Emacs regexp/incrementer question


From: Tim Morley (remove vegetable for email address)
Subject: Emacs regexp/incrementer question
Date: Thu, 16 Jan 2003 12:15:23 +0100

Hi all.

Does anybody know of a way to include an incrementing number in a regexp
search-and-replace in Emacs? What I want to do is search for a regexp, and
the first time I find it, replace it with "case 1", the second time replace
it with "case 2", etc.

Even if the solution is a several-stager, I'd be more than happy, because
I'm currently having to replace each occurrence with "case xxx" and then
change each "xxx" to a number by hand afterwards -- hardly ideal. I could
use awk or something to change the xxx's to incrementing numbers, but I'd
much prefer to do it all in Emacs if I can.

Thanks in advance for your help.


Tim Morley




reply via email to

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