View Single Post
Old 07-01-2011, 04:52 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,094
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by greenlees View Post
A lot of my epub books have class="whitespace" or class="softbreak" where there once were page breaks from conversions in their past life. And I want to remove them, especially when they are mid sentence.

I seem to have no problems using regex to unwrap lines with other calibre classes. But it never works with these classes.

eg

if I test for the following regex calibre finds 223 instances:

([a-z0-9-,])(</p>)(\s)(<p class="whitespace">\s?</p>
<p class="calibre3">)

I want to replace it with

\1\3

But the conversion never works. Nothing happens. After conversion calibre still finds 223 instances and the book looks the same.

Can any expert out there tell me what I'm missing here?

sorry if this question has been asked and answered before, but I couldn't find anything in the search.

thanks so much in advance for any help!!
I added a more flexible space detection in red.
Personally, I use Sigil s I can see exactly what a Search finds (and the results of my replace )
theducks is online now   Reply With Quote