I'm wondering if there is any way to include or exclude files from the results of find(1) based on the output or exit code of another program. Specifically I'd like to be able to run find(1) such that it returns only those files that contain a positive match for a regular expression.
I realize that this can be accomplished by piping the output of find(1) through egrep but I'd like to be able to do it all from within find(1).
For example, is there any way to convert the following into a single invocation of find(1) without any pipes?
find . [test] | xargs egrep -l [regex]