View Single Post
Old 11-30-2017, 12:43 PM   #5
odamizu
just an egg
odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.
 
odamizu's Avatar
 
Posts: 1,838
Karma: 8006102
Join Date: Mar 2015
Device: Kindle, iOS
Quote:
Originally Posted by Turtle91 View Post
Code:
search: <body>\s*<p>Chapter (.*?)</p>
replace: <body>\n<h1>Chapter \1</h1>\n
Omigod, you guys are fabulous!

I'm trying to learn regex, but it's been slow going as regex tends to make my brain curl up into a fetal ball and start whimpering.

Finding the chapter headings hasn't been a problem. I search: <p class="chapterHead"> replace: <h1 class="chapterHead">

But then I would go in and manually change each closing </p> tag to an </h1> Urgh.

I've tried search: <p class="chapterHead">.*?</p> replace <h1 class="chapterHead">.*?</h1> but that had unhappy results.

Turtle91 for the proper regex to automate the entire process!
odamizu is offline   Reply With Quote