View Single Post
Old 08-29-2024, 07:16 PM   #3
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,355
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Try:

Find: <title>.*?Chapter\s*(\d*?)\s*.*?</title>
Replace: <title>Chapter \1</title>

<title> & </title> are just the bounding tags
.*? is any number (or none) of any characters
\s* is any number (or none) spaces
(\d+?) is 1 or more numerical digits and it remembers what it finds


The Replace simply inserts the remembered digits into the phrase using the \1.


There are some good regex tutorials that will really help when editing code. It doesn't take long to get the basics....it does take forever to become a master... I'm definitely not there yet!

Make sure you focus on the PCRE flavor of Regex...that is what Sigil uses.


Cheers,
Turtle91 is offline   Reply With Quote