I've been using ACK for searching my code base, and it's a wonderful tool. However, it has (in my opinion) one important limitation - it does not allow multi-line matching of regular expressions.
To overcome that limitation, I'd like to filter a set of files which contain a certain expression, and then filter them again looking for a second expression (given that both expressions are most likely not on the same line). I've tried running the following command, with no success (it returns nothing):
ack -l --type=java "(List|Collection|Map|Set)" | ack --type=java "String"
And I'd rather not use grep
, since I want to limit my searches to java files, ignoring .cvs dirs, .svn dirs, etc. (something ack
does by default) Any ideas?