App-Greple

 view release on metacpan or  search on metacpan

script/greple  view on Meta::CPAN


=over 7

=item B<colors>

Color variation module.
See L<App::Greple::colors>.

=item B<find>

Module to use L<find(1)> command to help recursive search.
See L<App::Greple::find>.

=item B<dig>

Module for recursive search using B<find> module.  Defines C<--dig>,
C<--git> and C<--git-r> options. See L<App::Greple::dig>.

=item B<pgp>

Module to search B<pgp> files.
See L<App::Greple::pgp>.

=item B<select>

Module to select files.
See L<App::Greple::select>.

=item B<perl>

Sample module to search from perl source files.
See L<App::Greple::perl>.

=back

Other modules are available at CPAN, or git repository
L<https://github.com/kaz-utashiro/>.


=head1 OPTIONS


=head2 PATTERNS


If no positive pattern option is given (i.e. other than C<--not> and
C<--may>), B<greple> takes the first argument as a search pattern
specified by C<--le> option.  All of these patterns can be specified
multiple times.

Command itself is written in Perl, and any kind of Perl style regular
expression can be used in patterns.  See L<perlre(1)> for detail.

Note that multiple line modifier (C<m>) is set when executed, so put
C<(?-m)> at the beginning of regex if you want to explicitly disable
it.

Order of capture group in the pattern is not guaranteed.  Please avoid
to use direct index, and use relative or named capture group instead.
For example, if you want to search repeated characters, use
S<< C<(\w)\g{-1}> >> or S<< C<(?E<lt>cE<gt>\w)\g{c}> >> rather than
S<< C<(\w)\1> >>.

Extended Bracketed Character Classes (C<(?[...])>) and Variable Length
Lookbehind can be used without warnings.  See
L<perlrecharclass/"Extended Bracketed Character Classes"> and
L<perlre/"(?<=pattern)">.

=over 7

=item B<-e> I<pattern>, B<--and>=I<pattern>

Specify the positive match pattern.  Next command prints lines containing
all of C<foo>, C<bar> and C<baz>.

    greple -e foo -e bar -e baz

=item B<-t> I<pattern>, B<--may>=I<pattern>

Specify the optional (tentative) match pattern.  Next command prints
lines containing C<foo> and C<bar>, and highlights C<baz> if it exists.

    greple -e foo -e bar -t baz

Since it does not affect the bare pattern argument, you can add the
highlighting word to the end of the command argument as follows.

    greple foo file
    greple foo file -t bar
    greple foo file -t bar -t baz

=item B<-r> I<pattern>, B<--must>=I<pattern>

Specify the required match pattern.  If one or more required pattern
exist, other positive match pattern becomes optional.

    greple -r foo -r bar -e baz

Because C<-t> promotes all other C<-e> patterns to required, the next command
does the same thing.  Mixing C<-r>, C<-e> and C<-t> is not recommended,
though.

    greple -r foo -e bar -t baz

=item B<-v> I<pattern>, B<--not>=I<pattern>

Specify the negative match pattern.  Because it does not affect the
bare pattern argument, you can narrow down the search result like
this.

    greple foo file
    greple foo file -v bar
    greple foo file -v bar -v baz

=back

In the above pattern options, space characters are treated specially.
They are replaced by the pattern which matches any number of white
spaces including newline.  So the pattern can expand to multiple
lines.  Next commands search the series of word C<foo> C<bar> C<baz>
even if they are separated by newlines.



( run in 0.547 second using v1.01-cache-2.11-cpan-75ffa21a3d4 )