Objective
I have a .txt book from project Gutenberg, where an example chapter header would be -
Code:
[2]
THIEVES BREAK IN AND STEAL
I want to get it in the form -
Code:
<h2>2. THIEVES BREAK IN AND STEAL</h2>
Issue 1
When I try the regex search, it shows as
Code:
<p>[2]</p>
<h2>THIEVES BREAK IN AND STEAL</h2>
Is this expected? I'm hundred percent sure I'm selecting the .txt file. It would be fine if the regex worked properly on this, but it's not working as stated below -
Issue 2
When I use the following regex -
Code:
(?m)<p>\[([\d]*?)\]</p>\s+<h2>.*?</h2>
it matches the titles, but it does not do anything when I actually try to convert!
How can I get the conversion?
Addendum
The book on which I'm trying to operate is the text version here -
http://www.gutenberg.org/ebooks/6984