support taking regex from external source #116

Closed
adavies42 opened this Issue Mar 8, 2010 · 5 comments

4 participants

@adavies42

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

@mlsquires

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.

@petdance
Owner

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?

@mlsquires

For grep, I can prepare a file that looks like this:
logger\s*=
FunkyLogger
createLogger

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.

@petdance
Owner

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.

@hoelzro
Collaborator

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