support taking regex from external source #116

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

Comments

Projects
None yet
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.

Collaborator

petdance commented Feb 18, 2013

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:
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.

Collaborator

petdance commented Feb 18, 2013

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 hoelzro referenced this issue in beyondgrep/ack2 Aug 28, 2013

Closed

support taking regex from external source #353

Collaborator

hoelzro commented Aug 28, 2013

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