View Single Post
Old 08-09-2014, 01:51 AM   #16
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
Quote:
Originally Posted by DiapDealer View Post
I don't follow you. The href="whatever" bit is part of the 'a' tag. you can't strip the 'a' tags without removing the href. Just try the regex and you'll see exactly what it will remove. There's no need to wonder.
ok - lets see. I create a 1 line book in sigil using this previously posted example:
<h1 class="calibre10" id="rw-h1_319849-00001"><a class="calibre7" href="../Text/9780857900135_toc.html">4</a></h1>

now I run your (sigil flavored) regex- you are right - it works !

so can you walk me though HOW it works, please -using the above example

I am impressed that it zaps both eth opening and the closing tag, in a single pass, and without needing a \1 replace anywhere

PS re the concern that I may over-zealously zap too much stuff:
My usual precaution in sigil is to run count all, to begin with; if that returns a count that matches the number of chapters, then clearly I have no instances outside of chapter headers to worry about & I can run replace all

Last edited by cybmole; 08-09-2014 at 01:54 AM.
cybmole is offline   Reply With Quote