From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Yair Friedman Newsgroups: gmane.emacs.help Subject: Re: Regexp Query/Replace Without Trashing Original Text Date: Mon, 02 Aug 2004 16:56:29 +0200 Organization: ICTS Technologies B.V. Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: 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 1091455319 1270 80.91.224.253 (2 Aug 2004 14:01:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 2 Aug 2004 14:01:59 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 02 16:01:48 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 1BrdNs-0005Tu-00 for ; Mon, 02 Aug 2004 16:01:48 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BrdRG-0000VL-Ck for geh-help-gnu-emacs@m.gmane.org; Mon, 02 Aug 2004 10:05:18 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.airnews.net!cabal13.airnews.net!cabal11.airnews.net!newshosting.com!nx01.iad01.newshosting.com!194.90.1.17.MISMATCH!news2.netvision.net.il!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 21 Original-NNTP-Posting-Host: fwrouter-icts.ser.netvision.net.il Original-X-Trace: news2.netvision.net.il 1091454884 17959 199.203.174.122 (2 Aug 2004 13:54:44 GMT) Original-X-Complaints-To: usenet@netvision.net.il Original-NNTP-Posting-Date: Mon, 2 Aug 2004 13:54:44 +0000 (UTC) X-Zippy: Is this going to involve RAW human ecstasy? X-Attribution: Yair X-Hebrew-date: 15 Av 5764 User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (windows-nt) Cancel-Lock: sha1:cELU/ub6lMR7xBYv7ZphaVamQi8= Original-Xref: shelby.stanford.edu gnu.emacs.help:124599 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:19932 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:19932 On Sat, 31 Jul 2004 03:37:48 -0700, "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). You want to replace "\$\([A-Z_]+\)" with "$global_array(\1)", but as Kai suggested keyboard macros are more easy most of the time.