From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Pascal Bourguignon Newsgroups: gmane.emacs.help Subject: Re: regexp help Date: Sat, 03 Feb 2007 23:18:05 +0100 Organization: Informatimago Message-ID: <87lkjeubqa.fsf@thalassa.informatimago.com> References: <1170458444.534992.259290@a75g2000cwd.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1170542465 16370 80.91.229.12 (3 Feb 2007 22:41:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 3 Feb 2007 22:41:05 +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 Feb 03 23:40:55 2007 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 1HDTYy-0005NR-5h for geh-help-gnu-emacs@m.gmane.org; Sat, 03 Feb 2007 23:40:52 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HDTYy-0001xe-Qe for geh-help-gnu-emacs@m.gmane.org; Sat, 03 Feb 2007 17:40:52 -0500 Original-Path: shelby.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 38 Original-X-Trace: individual.net beqVfUedlQ+IXoX8LkN1fQyVoHbyqqrJ5J5C1rwIapUtEoGB4f Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en X-Disabled: X-No-Archive: no User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux) Cancel-Lock: sha1:nTmu0ASIDJ0RAYIB71u672LcXu4= Original-Xref: shelby.stanford.edu gnu.emacs.help:145272 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:40878 Archived-At: Matthew Flaschen writes: > gokhalen@gmail.com wrote: >> Hi, >> >> I needed to replace lines matching the following pattern >> >> "hello 123456123456" >> >> with >> >> "hello 123456 123456" >> >> I used >> >> M-x replace-regexp RET hello ...... RET \& / >> * NOTE: a white space follows the \& */ >> >> To do this. >> >> I was wondering how I would do this with the \d construct. That is how >> would I do this along the lines of > > I'm not sure, but I think you want this: > > M-x replace-regexp > \([0-9][0-9][0-9][0-9][0-9][0-9]\)\([0-9][0-9][0-9][0-9][0-9][0-9]\) RET > \1 \2 RET > > There may be some way to avoid repeating the [0-9] but I couldn't figure > that out. \([0-9]\{6\}\)\([0-9]\{6\}\) -- __Pascal Bourguignon__ http://www.informatimago.com/ The world will now reboot. don't bother saving your artefacts.