View Single Post
Old 05-26-2012, 02:43 PM   #43
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 80,138
Karma: 148951761
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by DiapDealer View Post
That would work fine, I guess... if I wanted to spend all day correcting an ebook with 100+ chapters.

Or I could just search for <p class=.*?>Chapter(.*?)</p> and replace it with <h2>Chapter\1</h2> and call it a day.
But some books don't use the work Chapter. So you can get One, Two, Three, etc.. for your chapter titles. So there's no way to fix it easily with regex is the class uses is also used elsehwere in the book. The way I suggested uses the heading option to change the chapter headers from <p to <h2 and that gives you then the way to do the search/replace easily. So sure, your way would work only if Chapter was a used word in all the chapter titles.
JSWolf is offline   Reply With Quote