#708679 Please add option to print regex that matched instead of matching text (or similar)

Package:
grep
Source:
grep
Description:
GNU grep, egrep and fgrep
Submitter:
Andras Korn
Date:
2014-11-20 08:57:13 UTC
Severity:
wishlist
#708679#5
Date:
2013-05-17 16:35:32 UTC
From:
To:
Hi,

I have a use case where I have a large amount of text incoming on stdin, and
a list of regular expressions in a file. I want to know whether there are
regular expressions in the file that match none of the lines of stdin.
(Ideally I'd also want to know which ones these are, but that's less
important.)

Currently, grep can't do this. While this use case is perhaps too specific,
the problem could be solved if grep could print matching regexes instead of
matching text; I could then pipe its output through | sort -u | wc -l and
see if that equals the number of lines in my file.

Please add this feature.

Thanks!