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 | |
$ |
$ grep -Pz '(?s)<title>.*</title>' ~/example.html
not it
Just beware -z adds a trailing NUL char to the output.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ grep --version
GNU grep 2.6.3
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.