beyondgrep / ack2

**ack 2 is no longer being maintained. ack 3 is the latest version.**
https://github.com/beyondgrep/ack3/
Other
1.48k stars 140 forks source link

^\s+ matches empty lines #579

Closed hoelzro closed 8 years ago

hoelzro commented 9 years ago

For example:

$ echo "\n\n\n" | ack '^\s+' | wc -l
4

This is because \s is matching the newline characters.

petdance commented 9 years ago

ack1 did not do this

$ ack1 --version
ack 1.96
Running under Perl 5.10.1 at /usr/local/bin/perl

Copyright 2005-2011 Andy Lester.

This program is free software.  You may modify or distribute it
under the terms of the Artistic License v2.0.

$ echo "\n\n\n" | ack1 '^(\s+)' | wc -l
0
f2404 commented 8 years ago

Zero for me:

$ echo "\n\n\n" | ack '^\s+' | wc -l
0
$ ack --version
ack 2.14
Running under Perl 5.22.0 at /usr/bin/perl

Copyright 2005-2014 Andy Lester.

This program is free software.  You may modify or distribute it
under the terms of the Artistic License v2.0.
hoelzro commented 8 years ago

Oops, I think I forgot to mark this as fixed when I fixed this.