unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Pascal Bourguignon <pjb@informatimago.com>
To: help-gnu-emacs@gnu.org
Subject: Re: regexp help
Date: Sat, 03 Feb 2007 23:18:05 +0100	[thread overview]
Message-ID: <87lkjeubqa.fsf@thalassa.informatimago.com> (raw)
In-Reply-To: mailman.3926.1170476834.2155.help-gnu-emacs@gnu.org

Matthew Flaschen <matthew.flaschen@gatech.edu> 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.

  parent reply	other threads:[~2007-02-03 22:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-02 23:20 regexp help gokhalen
2007-02-03  3:37 ` HS
2007-02-03  4:27 ` Matthew Flaschen
2007-02-03  4:31   ` Matthew Flaschen
     [not found] ` <mailman.3926.1170476834.2155.help-gnu-emacs@gnu.org>
2007-02-03 20:31   ` M G Berberich
2007-02-03 22:18   ` Pascal Bourguignon [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-04-23 14:34 Neal Becker
     [not found] <mailman.10741.1208961303.18990.help-gnu-emacs@gnu.org>
2008-04-23 15:59 ` Johan Bockgård
2008-04-23 16:04 ` tyler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lkjeubqa.fsf@thalassa.informatimago.com \
    --to=pjb@informatimago.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).