EX: extract text in between title tags: const htmlText = '<html><title>Example Title</title><body>abc</body></html>` const regex = /(?<=<title>).*?(?=\</title>)/; const matches = htmlText.match(regex); const title = matches && matches.shift();