bawi@hp:~$ cat a.txt aaabbb cccddd dddbbb xxxxxx cccfff bawi@hp:~$ pcregrep -M 'b\nc' a.txt aaabbb cccddd bawi@hp:~$ pcregrep -M 'b(\n|.)*c' a.txt aaabbb cccddd dddbbb xxxxxx cccfff
bawi@hp:~$ cat b.txt 1.ERROR test1 known-pattern1 other1.1 2.DEBUG test2 some data2.1 some data2.2 3.ERROR test3 undefined other3.1 4.ERROR test4 known-pattern2 bawi@hp:~$ pcregrep -M 'ERROR .*\n' b.txt | pcregrep -M -v '\nknown-pattern1' | pcregrep -M -v '\nknown-pattern2' 3.ERROR test3 undefined
Advertisement