View Single Post
Old 07-14-2012, 04:37 PM   #4
Serpentine
Evangelist
Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.
 
Posts: 416
Karma: 1045911
Join Date: Sep 2011
Location: Cape Town, South Africa
Device: Kindle 3
Quote:
Originally Posted by LKJT View Post
I'll have to edit every word in every book manually. Is that so?
It's pretty easy with regex, however the flavour (PCRE) used in Sigil makes it a bit trickier than it needs to be

This is a simple way to do it - however PCRE doesn't allow this.
Code:
(?<=>[^<]*)(([dg])\2*)
About the best you will get is something like:
Code:
Find:
First run : (?<=>)([^<]*?)(([dg])\3*)
Run until 0 matches : (?<=>)([^<]+?)(([dg])\3*)

Replace:
\1<span class="red">\2</span>
You also need to avoid hitting things like the title tags. It would become pretty complex and useless at this point - as you're unlikely to use it.

In short - upload the book somewhere, then send me a link to it, I'll make the modification as needed. If you need to do this on multiple books, I'll write a little script to do it on epubs.

Last edited by Serpentine; 07-14-2012 at 04:42 PM.
Serpentine is offline   Reply With Quote