-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
ag for multiple patterns #551
Comments
You can use |
Thanks for the solution, ZyX-I. |
@ZyX-I |
@c02y You asked the equivalent for Also you do not want AND. AND in regexes can be expressed via |
For others who would like something similar, I accomplished this by chaining multiple ag calls together using
This has the downside of only highlighting the term in the last query. If you want to hightlight both, this will work:
|
@danthegoodman
only prints the matching lines number but not the file name if one file matches the pattern. |
I needed to add
Bug #1164 prevents printing the filename if only one filename is passed to the final |
What about when you want files that mention 2 words (but those 2 words can be anywhere in the file). |
@HaleTom on ag version 0.31.0 is Now would be nice pattern1 AND NOT(pattern2). I suspect |
!! careful about this, I noticed if used like this Solution for that seems to be
|
I wrote a little script which integrates some of the suggestions here and provides more features: aag. |
Why -e is not implemented, BTW? Cluttering? |
For example, I got files which one or more of them contains:
I want to know which files contains
one
ANDfour
(which may be in the different lines) at the same time,I can use
grep -e one -e four /dir/files*
to get this, can I do that usingag
?The text was updated successfully, but these errors were encountered: