pipe rg filenames into to itself #1772
-
Dear ripgrep maintainers, I currently use multiple ripgrep executions to emulate the "AND" logic operator, like this:
This technique works well for me but I was hoping to remove the dependency on I am using My question is
I feel Thanks for the amazing work. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I'm sorry I just realized a bigger problem is the positioning of the argument, instead of the line terminators. When using pipe, |
Beta Was this translation helpful? Give feedback.
-
Thanks for the question. There is an issue tracking boolean matching that would permit one to express things like "matches foo and bar," but that's intended to work at a line level. Working at the file level as you describe here is a different endeavor, and no, there are no plans to add support for this use case to ripgrep. Using xargs with a pipeline is the best solution. But if you need to do this on Windows, you can, it will just be more verbose. I don't understand your suggestion about line terminators. I don't see how that would resolve your problem. Please provide an example of what would solve your problem. As a small side note, you can solve a subset of cases via a multiline regex. For example, to match both foo and bar, you would use |
Beta Was this translation helpful? Give feedback.
Thanks for the question.
There is an issue tracking boolean matching that would permit one to express things like "matches foo and bar," but that's intended to work at a line level. Working at the file level as you describe here is a different endeavor, and no, there are no plans to add support for this use case to ripgrep. Using xargs with a pipeline is the best solution. But if you need to do this on Windows, you can, it will just be more verbose.
I don't understand your suggestion about line terminators. I don't see how that would resolve your problem. Please provide an example of what would solve your problem.
As a small side note, you can solve a subset of cases via a multiline regex…