I am looking to substitute anything that is not an HTML tag from an HTML document. So, basically trying to get rid of all the text within the document.
I have the below regex to remove all HTML from a string, but need help with the opposite scenario.
$string =~ s/<[^>]+>//g;
Thanks.
<html><body>Here's some <b>bold</b> text!</body></html>, are you looking for the strings "Here's some " and " text!"? Because neither of those strings are outside of an HTML tag (they're both inside the<body>tag).