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

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

Re: Replace regexp question


From: Pascal J. Bourguignon
Subject: Re: Replace regexp question
Date: Sat, 08 Jun 2013 14:41:02 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Leandro Marcolino <leandromarcolino@gmail.com> writes:

> Hello, all!..
>
> I am trying to add text after multiple occurrences of a group, but it is not
> working. For example, if I try to change the following: "aaaaaa" to
> "aaaaaab", I end up with "ab"...
>
> I am looking for the regexp: \(a\)+ and I replace by \1b. But then the
> sequence of a's is reduced to a single "a". How can I make the final text
> have the same number of occurrences of the group as the original text?..

That's because there is a single a inside \( \)!
Try: \(a+\) -> \1b

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.
You can take the lisper out of the lisp job, but you can't take the lisp out
of the lisper (; -- antifuchs


reply via email to

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