grep a file with a list of regular expressions
I have a large file of regular expressions, one per line. I would like to inverse grep another multi-line file against any regular expression that appears in the first file. Something like this:
grep -v fileWithManyRegu开发者_StackOverflowlarExpressions fileThatMightMatchSomeRegularExpressions
Is there an elegant method to do this aside from looping through every regular expression?
grep -v -f regexes.txt content.txt
At least with Gnu grep you can use --file=<filename>
and all should be well.
精彩评论