(?<=)(.*?)(?=<\/p>)
In Visual Studio Code, start a search (making sure to activate the “use regex” button) and enter the parameters above. Replace the p tag with whatever HTML tag you need. Press alt+enter to select all occurrences of the match, then you can copy+paste into a new document. If you want to search between closing and opening tags instead, simply swap around the first and last parts that are between parentheses.
My common use case for this is to extract page URLs from an XML sitemap. I use tags in the regex and can then copy the page URLs into a new document.

Leave a Reply