Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support taking regex from external source #116

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

support taking regex from external source #116

adavies42 opened this issue Mar 8, 2010 · 5 comments

Comments

@adavies42
Copy link

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

@mlsquires
Copy link

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
Copy link
Collaborator

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
Copy link

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
Copy link
Collaborator

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
Copy link
Collaborator

hoelzro commented Aug 28, 2013

Migrated to ack2 queue.

@hoelzro hoelzro closed this as completed Aug 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants