unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Leandro Marcolino <leandromarcolino@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Replace regexp question
Date: Sat, 8 Jun 2013 10:27:28 -0700	[thread overview]
Message-ID: <CAPkggAiZxdRAaBNUuY2bTFgi0oLywytsXNNCnEbG91hUjY_9NA@mail.gmail.com> (raw)
In-Reply-To: <CAPkggAgSgsMCE-+h3N=Wfi9gAv+i=mx5Yd_7WsvXtkkww0qDqA@mail.gmail.com>

Oh, I think I got it. I nested the groups like: "<span lang=ZH-CN
>\(\(&#31169;\)+\)</span><span lang=PT-BR -> <span lang=ZH-CN
style='letter-spacing:-5px'>\1</span><span lang=PT-BR". That works!.. :)

Thanks!..

Leandro


On Sat, Jun 8, 2013 at 9:46 AM, Leandro Marcolino <
leandromarcolino@gmail.com> wrote:

> Just to be clear, when I say replace by: "<span lang=ZH-CN
> style='letter-spacing:-5px'>&#31169;&#31169;&#31169;</span><span
> lang=PT-BR", I mean that the number of &#31169; must be the same as in
> the original text.
>
> Thanks!..
>
> Leandro
>
>
> On Sat, Jun 8, 2013 at 9:44 AM, Leandro Marcolino <
> leandromarcolino@gmail.com> wrote:
>
>> Thank you very much for all the replies!.. :) But, maybe my example was
>> too simplistic.... hehe
>>
>> I want to file occurrences of "<span lang=ZH-CN
>> >&#31169;&#31169;&#31169;</span><span lang=PT-BR", but the number of
>> &#31169; can be one or more, and replae by "<span lang=ZH-CN
>> style='letter-spacing:-5px'>&#31169;&#31169;&#31169;</span><span
>> lang=PT-BR".
>>
>> If I try: "<span lang=ZH-CN >\(&#31169;+\)</span><span lang=PT-BR ->
>> <span lang=ZH-CN style='letter-spacing:-5px'>\1</span><span lang=PT-BR"
>> then no pattern is found
>> If I try: "<span lang=ZH-CN >\(&#31169;\)+</span><span lang=PT-BR ->
>> <span lang=ZH-CN style='letter-spacing:-5px'>\1</span><span lang=PT-BR"
>> then the sequence of &#31169; changes to a single &#31169;.
>>
>> Is there a way to solve this problem?...
>>
>> Thank you very much!..
>>
>> Thanks,
>> Leandro
>>
>>
>> On Sat, Jun 8, 2013 at 8:11 AM, Pascal J. Bourguignon [via Emacs] <
>> ml-node+s1067599n288199h15@n5.nabble.com> wrote:
>>
>>> Leandro Marcolino <[hidden email]<http://user/SendEmail.jtp?type=node&node=288199&i=0>>
>>> 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
>>>
>>>
>>> ------------------------------
>>>  If you reply to this email, your message will be added to the
>>> discussion below:
>>>
>>> http://emacs.1067599.n5.nabble.com/Replace-regexp-question-tp288179p288199.html
>>>  To unsubscribe from Replace regexp question, click here<http://emacs.1067599.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=288179&code=bGVhbmRyb21hcmNvbGlub0BnbWFpbC5jb218Mjg4MTc5fC0xNDQxMDQ2NDk4>
>>> .
>>> NAML<http://emacs.1067599.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>>
>>
>>
>


  reply	other threads:[~2013-06-08 17:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1206.1370689126.22516.help-gnu-emacs@gnu.org>
2013-06-08 12:41 ` Replace regexp question Pascal J. Bourguignon
2013-06-08 16:44   ` Leandro Marcolino
2013-06-08 16:46     ` Leandro Marcolino
2013-06-08 17:27       ` Leandro Marcolino [this message]
2013-06-08  6:11 Leandro Marcolino
2013-06-08 12:39 ` Andreas Röhler
     [not found] <mailman.634.1179145690.32220.help-gnu-emacs@gnu.org>
2007-05-14 19:00 ` replace " Ralf Angeli
2007-05-14 20:08   ` Seweryn Kokot
  -- strict thread matches above, loose matches on Subject: below --
2007-05-14 10:33 Seweryn Kokot

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=CAPkggAiZxdRAaBNUuY2bTFgi0oLywytsXNNCnEbG91hUjY_9NA@mail.gmail.com \
    --to=leandromarcolino@gmail.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).