From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: Search and replace Date: Fri, 13 Jun 2008 23:13:59 -0400 Message-ID: References: <8a1207d0-febc-40a6-9fd5-15e1afb9d313@w34g2000prm.googlegroups.com> <6bg8udF3cavbgU1@mid.individual.net> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1213414844 4337 80.91.229.12 (14 Jun 2008 03:40:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 14 Jun 2008 03:40:44 +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 05:41:27 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 1K7Mdr-0007fj-1k for geh-help-gnu-emacs@m.gmane.org; Sat, 14 Jun 2008 05:41:27 +0200 Original-Received: from localhost ([127.0.0.1]:58659 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K7Md3-0004mB-2n for geh-help-gnu-emacs@m.gmane.org; Fri, 13 Jun 2008 23:40:37 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail Original-NNTP-Posting-Date: Fri, 13 Jun 2008 22:13:59 -0500 Original-Newsgroups: gnu.emacs.help Mail-Copies-To: nobody User-Agent: MT-NewsWatcher/3.5.3b2 (Intel Mac OS X) Original-Lines: 32 X-Usenet-Provider: http://www.giganews.com Original-NNTP-Posting-Host: 24.34.108.171 Original-X-Trace: sv3-UFyCF8s2I0GnTM2OG9wbuENiQDLSQr3CT5QrQgPP5LTaz1VpXiK6RJ9DxE0L++rPtAYCOjejGklw1GY!r+J228jwfHZLRYcGWjMyBFvlO2ZpWgdiXPZba2nENiLnSj78xddllzzXuxBa1ZmGqqwX8uQ207pA!Ii/i3xPrxTloToPTn7Y/9dKu8ooSzFrqH2nAMek= Original-X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.39 Original-Xref: news.stanford.edu gnu.emacs.help:159453 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:54811 Archived-At: In article <6bg8udF3cavbgU1@mid.individual.net>, Marc Tfardy wrote: > 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 Even simpler: M-x replace-regexp RET .+@ RET RET -- Barry Margolin, barmar@alum.mit.edu 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 ***