opensubscriber
   Find in this group all groups
 
Unknown more information…

h : help-gnu-emacs@gnu.org 26 November 2005 • 2:14PM -0500

Re: query-replace-regexp-swap ?
by David Kastrup

REPLY TO AUTHOR
 
REPLY TO GROUP



Bastien <bastien@xxx....> writes:

> I often come across this problem: how to swap two strings in a buffer?
> For instance, say that you want to exchange #000 and #FFF in an HTML
> page: all #000 should become #FFF and all #FFF should become #000.
>
> How to do this with one *single* function ?

If you are using Emacs CVS (which your headers indicate), the
following should do the trick:

C-M-% #\(\(000\)\|FFF\) RET \,(if &2 "FFF" "000") RET

If you want to know how to do this non-interactively, type
C-x ESC ESC
after the above command.

--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu....
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.