From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Pascal Bourguignon Newsgroups: gmane.emacs.help Subject: Re: Regexp Query/Replace Without Trashing Original Text Date: 01 Aug 2004 19:34:21 +0200 Organization: [posted via Easynet Spain] Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <877jsi3gpu.fsf@thalassa.informatimago.com> References: <1091270054.672720@sj-nntpcache-5> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1091381813 11358 80.91.224.253 (1 Aug 2004 17:36:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 1 Aug 2004 17:36:53 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Aug 01 19:36:46 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BrKGM-0004Zh-00 for ; Sun, 01 Aug 2004 19:36:46 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BrKJh-0004Vh-VM for geh-help-gnu-emacs@m.gmane.org; Sun, 01 Aug 2004 13:40:13 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsmi-us.news.garr.it!newsmi-eu.news.garr.it!NewsITBone-GARR!feed.news.tiscali.de!easynet-monga!easynet.net!easynet-post2!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Original-Lines: 25 Original-NNTP-Posting-Host: 62.93.174.79 Original-X-Trace: DXC=gVCV\=V:P3bBd4DjF1d]1 Original-Xref: shelby.stanford.edu gnu.emacs.help:124584 Original-To: help-gnu-emacs@gnu.org 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: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:19918 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:19918 "Tennis Smith" writes: > Hi, > > How can I convert something like this > > $GLOBAL_VAR > > to this: > > $global_array(GLOBAL_VAR) > > ?? > > Its easy to do a regexp query/replace for "\$[A-Z]", but I don't really want > to change either the leading dollar sign ("$") or the trailing uppercase > text (GLOBAL_VAR). M-x replace-regexp RET \$\([A-Z][A-Z_]*\) RET $global_array(\1) RET -- __Pascal Bourguignon__ http://www.informatimago.com/ There is no worse tyranny than to force a man to pay for what he does not want merely because you think it would be good for him. -- Robert Heinlein