I'm trying to do a invert match of an html multi line p tag block with grep.
It works non inverted:
grep -Pz '(?s)\s*<p id="internal_version">.*?</p>\s' test.html
but gives exit code 1 if inverted
grep -Pzv '(?s)\s*<p id="internal_version">.*?</p>\s' test.html
I would have expected to get the not matching content of the file.
Example test.html:
<!DOCTYPE html>
<html lang="en">
<body>
<div id="page-content-wrapper">
<div class="container-fluid">
<p id="internal_version">
<font size="+1" color="red"><strong>Attention:</strong> <br>
Text <br>
More Text 123 !%&/
</p>
</div>
</div>
</body>
</html>