How do I ignore specific directories via RegEx with ack?
I can use the --ignore-dir
option, but this does not let me specify a RegEx. I want to be able to i
In the interest of folks using a pre-1.96 version of ack (like me), you can use regex look around to do this. Here's an example:
ack --java 'text-pattern' -G '^((?!(test|target)).)*$'
This will search the text-pattern
in all Java
files recursively (from .) that DO NOT have the words test
or target
in their path.