View Single Post
Old 04-01-2024, 03:11 PM   #2
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 36,607
Karma: 146499190
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
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.

Last edited by DNSB; 04-01-2024 at 03:14 PM.
DNSB is offline   Reply With Quote