View Single Post
Old 04-06-2023, 12:03 PM   #16
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,997
Karma: 169810634
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Karellen View Post
In your example a simple regex would have fixed that
Find... <span class="text_14">(.*?)</span>
Replace... \1

Then look at what is leftover and figure out what it does and either leave it, replace it or remove it.
Unfortunately, your regex does horrible things if you have nested spans:

Code:
<span class="text_14"> blah de blah de blah<span class="text_17">more blah de blah</span>yet more blah de blah</span>
which your regex would convert to:

Code:
 blah de blah de blah<span class="text_17">more blah de blah yet more blah de blah</span>
It would be much safer to simply use:

search: <span class="text_14>
replace: <span>

and then remove the naked <span> tags using Diap's "Editing Toolbag" (Calibre) / "TagMechanic" (Sigil).

Last edited by DNSB; 04-06-2023 at 03:21 PM.
DNSB is offline   Reply With Quote