App-BoolFindGrep
view release on metacpan or search on metacpan
bfg - find and grep files using boolean expressions.
=head1 VERSION
version 0.06
=head1 DESCRIPTION
This program combines the power of three Unix tools (in their GNU versions): bool, find and grep to provide a way to search by filenames and/or by file contents using boolean expressions. Internaly, all boolean expressions with regexps/strings are tr...
Complex searches using B<grep> are very painful and B<bool> have lots of limitations and complex escape rules. B<bfg> simplify these searches by using more clear syntax and better performance in some cases.
For example, to search
first AND second AND third AND fourth AND NOT fifth
in filenames, and the same expression in file contents using B<find> and B<grep>, you need do:
find . \
-type f \
-name '*first*' -a \
=item * --glob-regexp, -g
Interprets each operand of C<--match-expr> as I<S<shell patterns>>.
=item * --files-with-matches, -l
Show only filenames.
=item * --slash-as-delim, -s
Inhibt operators and parentheses interpretation insid slashes. To use literal slashes, escape them with a backslash.
=back
=head1 EXAMPLES
=head2 "Finding" Perl files
All these options are equivalents:
$ bfg -I -f '\.pl$ OR \.pm$ OR \.t$ OR \.pod$'
( run in 0.389 second using v1.01-cache-2.11-cpan-c21f80fb71c )