I have a book with 25 chapters where the 'Chapter' is in the same font size as the rest of the text; It looks like this;
<p class="calibre2"> CHAPTER ## </p>, where ## is the number 1 to 25.
I have devised the following which finds all the chapter entries;
<p class="calibre2">\sCHAPTER\s*\d*\s</p>
I would like to replace it with something similar to;
<h2 class="calibre3">CHAPTER ## </h2>, where ## is the number 1 to 25.
But am unable to devise the correct sequence to save the ## from the search function and insert into the replace function. I read

about back referencing including viewing "
An introduction to regular expressions" and "
Using the Search & Replace feature" without success.