View Single Post
Old 08-14-2023, 09:05 AM   #7
citrate
Junior Member
citrate began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Aug 2023
Device: BOOX Note 5+
Quote:
Originally Posted by kovidgoyal View Post
you want something like

Code:
//h:p[re.test(., '^Chapter.*', 'i')]
Well it doesn't work. I think above XPath expression is "find all <p>-tag text that matching the regular expression", but what I want is
  1. Find all text matching the regular expression
  2. Change the <p>-tag of the matching text to an <h>-tag
citrate is offline   Reply With Quote