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

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

Re: Another replace regexp with list question


From: Peter Dyballa
Subject: Re: Another replace regexp with list question
Date: Mon, 10 Jun 2013 12:30:29 +0200

Am 10.06.2013 um 03:03 schrieb Leandro Marcolino:

> This time I am trying to find occurrences of:
> 
> "<span style='color:white'>&#31169;&#31169;&#31169;&#31169;</span>", but
> the number of &#31169; can change from 1 to many.

        (replace-regexp "\\(<span style='color:white'>[&#3169;]+\\)&#31169;\\( 
*</span>\\)" "\\1 \\2")

In N-1 steps convert the last occurrence of "&#31169;" in a series of 
"&#31169;" to SPACE and bear in mind that the next time your regexp would need 
to have a SPACE before the final </span>.

The Nth step would be:

        (replace-regexp "\\(<span style='color:white'>\\)&#31169;\\( 
*</span>\\)" "\\1 \\2")

to convert the last left "&#31169;" to a SPACE.

--
Greetings

  Pete

"A TRUE Klingon warrior does not comment his code."




reply via email to

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