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

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

Re: Search and replace


From: Barry Margolin
Subject: Re: Search and replace
Date: Fri, 13 Jun 2008 23:13:59 -0400
User-agent: MT-NewsWatcher/3.5.3b2 (Intel Mac OS X)

In article <address@hidden>,
 Marc Tfardy <address@hidden> wrote:

> address@hidden schrieb:
> > Here's an example of what I'm trying to do in my emacs console:
> > 
> > address@hidden
> > address@hidden
> > address@hidden
> > 
> > Now after a search and replace this is what I want to get:
> > 
> > your-domain.com
> > my-domain.com
> > no-domain.com
> > 
> > I do not konw how to get rid of the 'me' 'you' 'this' and '@' in one
> > search and replace command.  I know how to change the @, but how would
> > be able to delete it, and everything else that happens to come before
> > it, on the same line.  I hope this makes sense to you.
> 
> M-x replace-regexp RET address@hidden(.*\) RET \1

Even simpler:

M-x replace-regexp RET .+@ RET RET

-- 
Barry Margolin, address@hidden
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***


reply via email to

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