Thread: epub editing
View Single Post
Old 01-10-2022, 11:02 AM   #14
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,113
Karma: 60406498
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
You really need to learn basic REGEX. It will be worth the effort

I have a snippet for my replace. \1 is the REGEX Captured
Code:
<h3 class="chapno">\1</h3>
The search is done on the fly, based upon what is there and what I want:
Note I only work in code view, so I highlight the entire Chapter-title block.,Ctrl-F (that puts it into the find)
eg Original
Code:
<p class="calibre_12"><span class="calibre3"><span class="bold"><span><span class="calibre27">Chapter 4</span></span></span></span></p>
Adjusted Search:
Code:
<p class="calibre_12"><span class="calibre3"><span class="bold"><span><span class="calibre27">(Chapter \d+)</span></span></span></span></p>
In this case, I am looking ONLY for a block that contains Chapter followed by a space and 1 0r more DIGITS. This will not affect any other similarly styled block (Prologue|Epilogue|Forward...)

Check out our Wiki entry
https://wiki.mobileread.com/wiki/Cal...n_introduction
theducks is offline   Reply With Quote