support taking regex from external source #116

adavies42 opened this Issue Mar 8, 2010 · 5 comments

4 participants


ack should be able to accept a regex from a file (or stdin), much like grep's "--file" option.


I just noticed that ack didn't have this. It's handy to build up some patterns in a file rather than editing the command line arguments.


Can you give an example of how this would work for you? What would this file look like? Do you have real-world examples for us to look at?


For grep, I can prepare a file that looks like this:

with one regexp per line. Then I use 'grep --file pats.txt ...' to have it use those patterns. It's equivalent to 'logger\s*=|FunkyLogger|createLogger' but easier to deal with.


Aha, so the "from a file" is secondary to "ORing a bunch of patterns together."

This definitely won't happen in ack 1.x, but maybe in ack 2.1 we'll think about it. I'll migrate this issue over to that queue.


Migrated to ack2 queue.

@hoelzro hoelzro closed this Aug 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment