Try wrapping the .*? in brackets. i.e. (.*?) which can be referenced by number. In the preplacement box, the first instance of (.*?) would be represented by \1, the second by \2, etc.
In your case I would use <h1 class="(.*?)">(.*?)</h1> <p class=".*?">.*?</p> as the search string and <h1 class="\1">\2</h1> as the replacement string.
If the classes are fixed, you could simply use <h1 class="whatever">(.*?)</h1> and \1 for the chapter title in the replacement string.
A quick visit to
Regex 101 and playing with their test environment is a good idea.