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

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

Re: case change in replacement text with regex-replace


From: David Kastrup
Subject: Re: case change in replacement text with regex-replace
Date: Wed, 18 Apr 2007 20:09:36 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.98 (gnu/linux)

Dieter Wilhelm <dieter@duenenhof-wilhelm.de> writes:

> bojohan+news@dd.chalmers.se (Johan Bockgård) writes:
>
>> Dieter Wilhelm <dieter@duenenhof-wilhelm.de> writes:
>>
>>> \U I didn't see in the elisp manual
>>
>> For the record, XEmacs does have \U:
>                   ^^^^^^
>
> Thank you, one of the few occasions were I could read that XEmacs has
> also it's advantages in comparison to Gnu Emacs.

\,(downcase \1)

can be used in Emacs 22 in the replacement text.  Sure, it is more
verbose, but also quite more flexible.  The Emacs manual has:

    For example, to add consecutively numbered strings like `ABC00042' to
    columns 73 to 80 (unless they are already occupied), you can use

         M-x replace-regexp <RET> ^.\{0,72\}$ <RET>
         \,(format "%-72sABC%05d" \& \#) <RET>


-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum


reply via email to

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