Note from 5 December 2022
I always forget how to extract the content of matching HTML tags with a REGEX, so here it is:
content.match(/<pre>(((?!<\/pre>).)*)<\/pre>/gs)
It uses negative lookahead.
(I know I should use the DOM API instead… 🤷♂️)
I always forget how to extract the content of matching HTML tags with a REGEX, so here it is:
content.match(/<pre>(((?!<\/pre>).)*)<\/pre>/gs)
It uses negative lookahead.
(I know I should use the DOM API instead… 🤷♂️)