help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: regexp help


From: Pascal Bourguignon
Subject: Re: regexp help
Date: Sat, 03 Feb 2007 23:18:05 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux)

Matthew Flaschen <address@hidden> writes:

> address@hidden 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]