Acme-CPANModules-GrepVariants
view release on metacpan or search on metacpan
can use look-ahead:
% grep -P '(?=.*foo)(?=.*bar)' FILES
but this does not capture (thus highlight) the patterns. To do that, you
can pipe to grep once more:
% grep -P '(?=.*foo)(?=.*bar)' FILES | grep -P '(foo|bar)'
but you introduce the complications of double filtering (e.g. filenames
in FILES is now the subject of the second grep).
Note that searching for multiple patterns in particular order
('foo.*bar'), or searching for aternates from multiple patterns
('foo|bar') is no problem in grep.
Some tools have been written to make it easier to specify multiple
patterns:
abgrep (from App::abgrep) sports a "--all" option to require all
patterns to appear in a line (in no particular order). Normally, when
% grep PAT $(pmlist -Rx)
cpangrep (from App::cpangrep) is a CLI for web service
<https://cpan.grep.me>, which is no longer operating. To grep from files
on CPAN, use <https://metacpan.org>.
grepl (from App::Grepl) uses PPI to let you grep over Perl *documents*;
it allows you to do things like: search only in Perl code comments or
inside string literals.
podgrep (from pmtools) greps from POD sections of Perl source.
4c. Variants: alternate source: CSV
csvgrep (from csvgrep)
csv-grep (from App::CSVUtils) allows you to apply Perl code against rows
of CSV.
4d. Variants: alternate source: word lists
lib/Acme/CPANModules/GrepVariants.pm view on Meta::CPAN
look-ahead:
% grep -P '(?=.*foo)(?=.*bar)' FILES
but this does not capture (thus highlight) the patterns. To do that, you can
pipe to grep once more:
% grep -P '(?=.*foo)(?=.*bar)' FILES | grep -P '(foo|bar)'
but you introduce the complications of double filtering (e.g. filenames in
FILES is now the subject of the second grep).
Note that searching for multiple patterns in particular order ('foo.*bar'), or
searching for aternates from multiple patterns ('foo|bar') is no problem in
grep.
Some tools have been written to make it easier to specify multiple patterns:
<prog:abgrep> (from <pm:App::abgrep>) sports a `--all` option to require all
patterns to appear in a line (in no particular order). Normally, when multiple
patterns are given (via multiple `-e` or `--regexp` options), grep will include
lib/Acme/CPANModules/GrepVariants.pm view on Meta::CPAN
% grep PAT $(pmlist -Rx)
<prog:cpangrep> (from <pm:App::cpangrep>) is a CLI for web service
<https://cpan.grep.me>, which is no longer operating. To grep from files on
CPAN, use <https://metacpan.org>.
<prog:grepl> (from <pm:App::Grepl>) uses <pm:PPI> to let you grep over Perl
*documents*; it allows you to do things like: search only in Perl code comments
or inside string literals.
<prog:podgrep> (from <pm:pmtools>) greps from POD sections of Perl source.
**4c. Variants: alternate source: CSV**
<prog:csvgrep> (from <pm:csvgrep>)
<prog:csv-grep> (from <pm:App::CSVUtils>) allows you to apply Perl code against
rows of CSV.
lib/Acme/CPANModules/GrepVariants.pm view on Meta::CPAN
look-ahead:
% grep -P '(?=.*foo)(?=.*bar)' FILES
but this does not capture (thus highlight) the patterns. To do that, you can
pipe to grep once more:
% grep -P '(?=.*foo)(?=.*bar)' FILES | grep -P '(foo|bar)'
but you introduce the complications of double filtering (e.g. filenames in
FILES is now the subject of the second grep).
Note that searching for multiple patterns in particular order ('foo.*bar'), or
searching for aternates from multiple patterns ('foo|bar') is no problem in
grep.
Some tools have been written to make it easier to specify multiple patterns:
L<abgrep> (from L<App::abgrep>) sports a C<--all> option to require all
patterns to appear in a line (in no particular order). Normally, when multiple
patterns are given (via multiple C<-e> or C<--regexp> options), grep will include
lib/Acme/CPANModules/GrepVariants.pm view on Meta::CPAN
% grep PAT $(pmlist -Rx)
L<cpangrep> (from L<App::cpangrep>) is a CLI for web service
L<https://cpan.grep.me>, which is no longer operating. To grep from files on
CPAN, use L<https://metacpan.org>.
L<grepl> (from L<App::Grepl>) uses L<PPI> to let you grep over Perl
I<documents>; it allows you to do things like: search only in Perl code comments
or inside string literals.
L<podgrep> (from L<pmtools>) greps from POD sections of Perl source.
B<4c. Variants: alternate source: CSV>
L<csvgrep> (from L<csvgrep>)
L<csv-grep> (from L<App::CSVUtils>) allows you to apply Perl code against
rows of CSV.
B<4d. Variants: alternate source: word lists>
( run in 1.167 second using v1.01-cache-2.11-cpan-39bf76dae61 )