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 [solved]


From: Le TeXnicien de Surface
Subject: Re: case change in replacement text with regex-replace [solved]
Date: Mon, 16 Apr 2007 08:56:12 +0200
User-agent: KNode/0.10.1

Dieter Wilhelm écrivait :

> Dieter Wilhelm <dieter@duenenhof-wilhelm.de> writes:
> 
>> I'd try it with the \, command with replace-regexp though
>>
>> (info "(emacs) Regexp Replace") <- put cursor behind parenthesis and
>> type C-x C-e.  The following is just an idea, I didn't check it.  I
>> assume you must also make the search and replace command case
>> sensitive.
>>
>> IDEA: \(.\)\(.\) -> \,(concat (upcase \1)(downcase \2) " " (...))
Well, thanks a lot for showing me the way out!

I succeeded with query-replace-regexp-eval
and the following
(I must say here that the text I work with is in the form « c="AB" »
and that I want to obtain « c="AB" or c="Ab" or c="aB" or c="ab" » from it)

Here the searching regexp « c="\([A-Z\)\([A-Z]\)" »
and here the expression evaluated

(concat "c=\"" (upcase \1) (upcase \2) "\" or c= \"" (upcase \1) 
(downcase \2) "\" or c= \"" (downcase \1) (upcase \2) 
"\" or c= \"" (downcase \1) (downcase \2) "\"")

hih :)
-- 
Le TeXnicien de Surface


reply via email to

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