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

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

Re: Regexp Query/Replace Without Trashing Original Text


From: Pascal Bourguignon
Subject: Re: Regexp Query/Replace Without Trashing Original Text
Date: 01 Aug 2004 19:34:21 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

"Tennis Smith" <tennis_smith@yahoo-remove-to-reply.com> 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


reply via email to

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