From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Matthew Flaschen Newsgroups: gmane.emacs.help Subject: Re: regexp help Date: Fri, 02 Feb 2007 23:31:30 -0500 Message-ID: <45C41022.1020302@gatech.edu> References: <1170458444.534992.259290@a75g2000cwd.googlegroups.com> <45C40F15.8060901@gatech.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1767897604==" X-Trace: sea.gmane.org 1170477118 29085 80.91.229.12 (3 Feb 2007 04:31:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 3 Feb 2007 04:31:58 +0000 (UTC) To: emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Feb 03 05:31:51 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 1HDCZ3-0002na-Q3 for geh-help-gnu-emacs@m.gmane.org; Sat, 03 Feb 2007 05:31:50 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HDCZ3-0003F9-8O for geh-help-gnu-emacs@m.gmane.org; Fri, 02 Feb 2007 23:31:49 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HDCYp-0003Dm-88 for help-gnu-emacs@gnu.org; Fri, 02 Feb 2007 23:31:35 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HDCYn-0003Be-HX for help-gnu-emacs@gnu.org; Fri, 02 Feb 2007 23:31:34 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HDCYn-0003Bb-D5 for help-gnu-emacs@gnu.org; Fri, 02 Feb 2007 23:31:33 -0500 Original-Received: from deliverator5.gatech.edu ([130.207.165.165]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.52) id 1HDCYn-0004Lv-1K for help-gnu-emacs@gnu.org; Fri, 02 Feb 2007 23:31:33 -0500 Original-Received: from deliverator5.gatech.edu (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 2BF731D1993 for ; Fri, 2 Feb 2007 23:31:32 -0500 (EST) (envelope-from matthew.flaschen@gatech.edu) Original-Received: from mailprx3.gatech.edu (mailprx3.prism.gatech.edu [130.207.171.17]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client CN "smtp.mail.gatech.edu", Issuer "RSA Data Security, Inc." (verified OK)) by deliverator5.gatech.edu (Postfix) with ESMTP id 0E1A11D1982 for ; Fri, 2 Feb 2007 23:31:32 -0500 (EST) (envelope-from matthew.flaschen@gatech.edu) Original-Received: from [128.61.73.81] (r73h81.res.gatech.edu [128.61.73.81]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (sasl: method=PLAIN, username=mflaschen3@mailprx3.gatech.edu, sender=n/a) by mailprx3.gatech.edu (Postfix) with ESMTP id C24CE22CA for ; Fri, 2 Feb 2007 23:31:31 -0500 (EST) (envelope-from matthew.flaschen@gatech.edu) User-Agent: Thunderbird 1.5.0.9 (X11/20070103) In-Reply-To: <45C40F15.8060901@gatech.edu> X-Enigmail-Version: 0.94.1.2 X-detected-kernel: Solaris 9 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:40864 Archived-At: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --===============1767897604== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig5ABC410CBA4D5B810699D8A5" This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig5ABC410CBA4D5B810699D8A5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Matthew Flaschen wrote: > 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 >=20 > I'm not sure, but I think you want this: >=20 > 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]\) RE= T > \1 \2 RET >=20 > There may be some way to avoid repeating the [0-9] but I couldn't figur= e > that out. Never mind. I just forgot the escape. The best way (I think) is: \([0-9]\{6\}\)\([0-9]\{6\}\) RET \1 \2 RET Matthew Flaschen --------------enig5ABC410CBA4D5B810699D8A5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFxBAiQ5LSyju97VkRAk3fAKCocXEE7A+GKHNw15f07Iry3GQtOACdFurG 8LEVNACPp7NYbb4SbzdCpps= =BQ7S -----END PGP SIGNATURE----- --------------enig5ABC410CBA4D5B810699D8A5-- --===============1767897604== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ help-gnu-emacs mailing list help-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-emacs --===============1767897604==--