So, I have a book I'm listening to using text-to-speech, but at the start of each chapter, the heading is written twice. With the tags "<h1>" and "<p>".
This ends up showing the title of the chapter in both heading and normal fonts, which isn't an issue when reading, but when listening, the text-to-speech will have to repeat it twice which is a bit annoying.
To solve this, I downloaded calibre and discovered Regex, so I went about a beginner tutorial and realised that I could isolate each instance this happened.
If I have something like
Quote:
Chapter 21: The New Beginning
Chapter 21: The New Beginning
|
Which would appear like this in the editor.
Code:
<h1>Chapter 21: The New Beginning</h1>
<p>Chapter 21: The New Beginning</p>
By running the code below in the search tab to search through the entire file
Code:
<h1.*?>Chapter .*?</h1>
<p>Chapter.*?</p>
I'm able to capture any instance of the title appearing twice.
My issue is this, by pasting
in the replace tab, instead of it replacing the text with what was supposed to be inside the "<h1>" tag, so in this case I expect to see
Quote:
Chapter 21: The New Beginning
|
Instead I get,
Is there a way to save the string gotten from the first code into the second