Closed shlomif closed 10 years ago
Hi,
On Tue, Sep 30, 2014 at 05:34:48AM -0700, Shlomi Fish wrote:
Patch with a test case is here:
http://www.shlomifish.org/Files/files/code/ack-git1.diff
ack -l '^use strict;' for example does not find any Perl files.
Furthermore, with "\A" instead of "^" this patch will likely not find it anyway.
Sounds similar to https://github.com/petdance/ack2/issues/491
Regards, Axel
ack does not do multiline matches. ack only deals with one line at a time.
@petdance : you misunderstand. It won't match a single line against the pattern of /^Prefix/ either.
shlomif[Module-Format@default]:$trunk/Module-Format/Module-Format$ ack '^use strict' lib/
lib/Module/Format/PerlMF_App.pm
3:use strict;
lib/Module/Format/Module.pm
4:use strict;
lib/Module/Format/ModuleList.pm
4:use strict;
lib/Module/Format.pm
4:use strict;
shlomif[Module-Format@default]:$trunk/Module-Format/Module-Format$ ack -l '^use strict' lib/
shlomif[Module-Format@default]:$trunk/Module-Format/Module-Format$ grep -rlP '^use strict' lib/
lib/Module/Format/PerlMF_App.pm
lib/Module/Format/Module.pm
lib/Module/Format/ModuleList.pm
lib/Module/Format.pm
shlomif[Module-Format@default]:$trunk/Module-Format/Module-Format$
@xtaran is right; this is a duplicate of #491.
Patch with a test case is here:
http://www.shlomifish.org/Files/files/code/ack-git1.diff
ack -l '^use strict;' for example does not find any Perl files.
Furthermore, with "\A" instead of "^" this patch will likely not find it anyway.
Also included below: