From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Le TeXnicien de Surface Newsgroups: gmane.emacs.help Subject: Re: case change in replacement text with regex-replace [solved] Date: Mon, 16 Apr 2007 08:56:12 +0200 Organization: les newsgroups par Orange Message-ID: <46231e0d$0$25936$ba4acef3@news.orange.fr> References: <461cc717$0$5074$ba4acef3@news.orange.fr> <4621e0c0$0$5094$ba4acef3@news.orange.fr> <87odlpxmh5.fsf@debby.local.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8Bit X-Trace: sea.gmane.org 1176708981 11060 80.91.229.12 (16 Apr 2007 07:36:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 16 Apr 2007 07:36:21 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Apr 16 09:36:15 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HdLl1-0001MD-FY for geh-help-gnu-emacs@m.gmane.org; Mon, 16 Apr 2007 09:36:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HdLpa-0005qG-Ss for geh-help-gnu-emacs@m.gmane.org; Mon, 16 Apr 2007 03:40:58 -0400 Original-Path: shelby.stanford.edu!newshub.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!proxad.net!193.252.118.146.MISMATCH!news.wanadoo.fr!news.wanadoo.fr!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: KNode/0.10.1 Original-Lines: 29 Original-NNTP-Posting-Date: 16 Apr 2007 08:56:13 CEST Original-NNTP-Posting-Host: 82.127.196.158 Original-X-Trace: 1176706573 news.orange.fr 25936 82.127.196.158:62473 Original-X-Complaints-To: abuse@orange.fr Original-Xref: shelby.stanford.edu gnu.emacs.help:147111 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:42715 Archived-At: Dieter Wilhelm écrivait : > Dieter Wilhelm 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