I have something like this in a file testtt
:
{It captures this! }
// question: 2572410 name: Question 2
::Question 2::[html] Is it going to be -40 tomorrow?
{
It can't
capture this!!! why?
}
when I do:
grep -o '{\([^}]*\)}' testttt
It can't capture the multi-line braces. Any help to modify it in way that it could capture both would be apppreciated!
PS. I have also tested the given solution from: How do I grep for multiple patterns on multiple lines? and it gives the following error:
grep: unescaped ^ or $ not supported with -Pz
You can find the text file of the output and file contents here
-z
(null terminated) mode you should ask that separately IMHO (the answer will probably be to use explicit\n
characters, something likegrep -Pzo "begin\n(.|\n)*\nend"
orgrep -Pzo "(?s)begin\n.*\nend"
) – steeldriver Nov 03 '16 at 01:21