Hi all,
I have a similar problem. My chapter headings are "1.", "2." etc. without any heading tags too. And I wanted to create a ToC by giving the headings tag and then using those tags to form the Contents.
My problem:
I've managed to use regex to capture the headings, but do not know how to replace it, because I still need to keep the "5." intact, and use replace all to change all the 100+ headings.
original code:
Code:
<p class="calibre2"><span class="bold">5.</span></p>
My regex to find:
Code:
<p class="calibre2"><span class="bold">\s*[0-9]+.*?</span></p>
My regex to replace:
Code:
<p class="calibre2"><span class="bold"><h3>???</h3></span></p>
Where ??? is a mystery to me. Please help!