TL;DR  When  *--count*  or  *--files-with-matches*  are used in conjunction 
with the  *^*  caret, no matches are returned. This was tested on Windows 7 
and OS X using ack version 2.14.


I've got several .h files that have lines starting with the word  'class':

*class FSomeDerived : public FSomeBase {...};*

*class FAnotherDerived : public FSomeBase {...};*


I also have multiple lines that contain the word 'class' somewhere within 
it, but that are not at the beginning of the line. On Windows, these .h 
files have CRLF (\r\n) line endings, and on OS X, the same .h files have 
only LF (\n) line endings.


*ack --hh '^class'*  correctly displays the .h files and full lines where '
class' is found at column 0 of the line.
*ack --hh --count '^class'*  shows all .h files that had been found and 
were searched, but all showed counts of  *:0*  even if they contain 'class' 
at column 0.
*ack --hh --files-with-matches '^class'*  shows no results at all.

*ack --hh '^'*  shows every line in every .h file, as it matches the 
beginning of ALL lines.
*ack --hh --count '^'*  shows a count of  *:1*  for every .h file.


Environments tested:
  Windows 7, running a MinGW32 terminal, ack version 2.14: *~/bin/ack --hh 
'^class'*
  Windows 7, running command prompt "cmd", ack version 2.14:  *perl 
%homepath%\bin\ack --hh "^class"*
  OS X 10.11.6 (El Capitan), ack version 2.14: *~/bin/ack --hh '^class'*

>From my tests, I can use the  *^*  caret without  *--count*  or  
*--files-with-matches*  but I cannot combine them.


Do I need to change something in how I'm testing for a pattern that begins 
at column 0 of these .h files?

-- 
You received this message because you are subscribed to the Google Groups "ack 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/ack-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to