Thread: Regex examples
View Single Post
Old 03-24-2012, 09:35 PM   #23
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,266
Karma: 2334301
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Hi

I am no expert at all so forgive me. I still have in my notebook a Regex that Zelda of world fame gave me a long time ago:
<span.sgc-5>([\w\s]*\w)</span>

I need to add a span tag to a span tag (that is to make a double span) without touching or removing the capital letter enclosed in the span. It's to make a box for drop-caps.

To make myself understood, I need to search and replace using Sigil, in code view, for all html files:
search
<span class="lettrine2">X</span>
replace
<span class="lettrine1"><span class="lettrine2">X</span></span>

X of course can be any letter from A to Z (capital letters only)
I had no success with the above Regex. Has anybody a solution for it?

I guess only \w would be needed since there is no space.

Last edited by roger64; 03-24-2012 at 09:44 PM.
roger64 is offline   Reply With Quote