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

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

Re: #1: How to do vi's 'g/foo/s/x/y/' #2: + with a Q-R "yes/no?"


From: Peter Dyballa
Subject: Re: #1: How to do vi's 'g/foo/s/x/y/' #2: + with a Q-R "yes/no?"
Date: Sun, 8 Apr 2007 21:07:04 +0200


Am 07.04.2007 um 19:51 schrieb David Combs:

(1) How to do, in gnu-emacs,  vi's 'g/foo/s/x/y/':

        M-x replace-regexp RET ^\(.*foo.*\)x\(.*\)$ RET \1y\2 RET and
        M-x replace-regexp RET ^\(.*\)x\(.*foo.*\)$ RET \1y\2 RET ?

I think it's necessary to distinguish the two cases where the MUST HAVE is left or right of the MUST NOT BE. Instead of replace-regexp you can also use query-replace-regexp.

It might be possible to unite these into one expression using alternatives.

--
Greetings

  Pete

Claiming that the Macintosh is inferior to Windows because most people use Windows, is like saying that all other restaurants serve food that is inferior to McDonald's.






reply via email to

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