Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion query-replace-regexp-swap ?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
David Kastrup  
View profile  
 More options Nov 26 2005, 1:14 am
Newsgroups: gnu.emacs.help
From: David Kastrup <d...@gnu.org>
Date: Sat, 26 Nov 2005 07:14:44 +0100
Local: Sat, Nov 26 2005 1:14 am
Subject: Re: query-replace-regexp-swap ?

Bastien <bast...@xxx.fr> 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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.