Grep regular expression list

I have a large regular expression file, one per line. I would like to invert grep another multiline file against any regular expression that appears in the first file. Something like that:

grep -v fileWithManyRegularExpressions fileThatMightMatchSomeRegularExpressions

Is there an elegant way to do this, besides having to iterate over all regular expressions?

+3
source share
2 answers
grep -v -f regexes.txt content.txt
+11
source

At least with Gnu grep you can use --file=<filename>, and everything should be fine.

+2
source

Source: https://habr.com/ru/post/1756011/


All Articles