13
4
How do I search for a phrase over multiple lines? E.g. Lets have the phrase "my ice tea" then it may be wrapped in text files:
as js skdfh dfh djh sf my
ice tea.
grep will not match since there is a newline in between. How do I match those? Another multiline pattern would be pattern1_\n_pattern2
I know the easiest way I do ATM is just grep for one part e.g. just ice with -A2 -B2 flag and then in that output againg for e.g. tea. But this is very tedious. So I am interessted on how do you would solve this.
1
possible cross site duplicate of: http://stackoverflow.com/questions/152708/how-can-i-search-for-a-multiline-pattern-in-a-file
– Ciro Santilli 新疆改造中心法轮功六四事件 – 2014-09-15T21:20:01.123