View Single Post
Old 09-14-2010, 05:07 AM   #9
tonyx3
Connoisseur
tonyx3 began at the beginning.
 
Posts: 55
Karma: 10
Join Date: Jan 2010
Device: Nexus One
Quote:
Originally Posted by Manichean View Post
I'm not quite sure how to go on about using the whole book as source in the re.test() function, but shouldn't
Code:
re.test(<whole book as source>, <span class="ts1">[A-Z]+<span class="ts2"><br/>, )
just use the regexp for chapter matching?
Another thing to try would be
Code:
/h:span[@class="ts1"]re.test(.,[A-Z]+,)/h:span[@class="ts2"]
Disclaimer: I didn't try the above myself. It might be horribly wrong...


Hrm.. I just tried that second one, but calibre said it was an invalid XPATH expression. I'm not sure but I think maybe you can't use /h:span twice.. ?
tonyx3 is offline   Reply With Quote