I think I found a bug, but perhaps I'm misunderstanding pattern
matching. I'm using the latest svn r910.
Given the following file:
$ cat test
123 foo bar
abcd
efgh
234 bar baz
ijk
############ EOF
I have done two searches:
### this colors the first digit in each line
$ ack '^[[:digit:]]' test
123 foo bar
234 bar baz
############ end of output
### this colors '123' and '234' on the two lines,
### and prints the entire file. '-C 0' has no effect
$ ack '^[[:digit:]]*' test
123 foo bar
abcd
efgh
234 bar baz
ijk
############ end of output
Is something wrong with my ack calls?
Thanks,
Ori
> ### this colors '123' and '234' on the two lines,
> ### and prints the entire file. '-C 0' has no effect
> $ ack '^[[:digit:]]*' test
> 123 foo bar
> abcd
> efgh
> 234 bar baz
> ijk
> ############ end of output
You're misunderstanding *. * means "0 or more". Every line in the
file matches zero or more digits.
You want +, which is "one or more".
xoxo,
Andy
--
Andy Lester => an...@petdance.com => www.petdance.com => AIM:petdance