From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marc Tfardy Newsgroups: gmane.emacs.help Subject: Re: Search and replace Date: Fri, 13 Jun 2008 23:59:40 +0200 Message-ID: <6bg8udF3cavbgU1@mid.individual.net> References: <8a1207d0-febc-40a6-9fd5-15e1afb9d313@w34g2000prm.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1213396848 2142 80.91.229.12 (13 Jun 2008 22:40:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 13 Jun 2008 22:40:48 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jun 14 00:41:31 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K7HxY-0004dr-RH for geh-help-gnu-emacs@m.gmane.org; Sat, 14 Jun 2008 00:41:28 +0200 Original-Received: from localhost ([127.0.0.1]:60079 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K7Hwk-0001uT-Qx for geh-help-gnu-emacs@m.gmane.org; Fri, 13 Jun 2008 18:40:38 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 37 Original-X-Trace: individual.net UpzUMCJ9Af9xagb1qK5xYwh/4ZmO2gsjeq4ipZvTfZ2DQrJlzE Cancel-Lock: sha1:tOmZ5pckkTm3LD4ZOp/VY62X5DA= User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) In-Reply-To: <8a1207d0-febc-40a6-9fd5-15e1afb9d313@w34g2000prm.googlegroups.com> Original-Xref: news.stanford.edu gnu.emacs.help:159452 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:54807 Archived-At: tho643@gmail.com schrieb: > Here's an example of what I'm trying to do in my emacs console: > > me@your-domain.com > you@my-domain.com > this@no-domain.com > > 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 .+@\(.*\) RET \1 But this macro do the same job: C-a ;; move-beginning-of-line C-SPC ;; set-mark-command C-s ;; isearch-forward @ ;; self-insert-command RET ;; newline C-w ;; kill-region C-n ;; next-line and than C-x C-k r on region :-) regards Marc