Created
December 3, 2018 17:22
-
-
Save rdp/0286d91624930bd11d0169d6a6337c33 to your computer and use it in GitHub Desktop.
grep multiline perl test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat ~/example.html | |
not it | |
<title> | |
yess 1 | |
2 | |
</title> | |
$ grep -P '(?s)<title>.*</title>' ~/example.html | |
$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ grep -Pz '(?s)<title>.*</title>' ~/example.html
<title> yess 1 2 </title>not it
Just beware -z adds a trailing NUL char to the output.