Skip to content

pipe rg filenames into to itself #1772

Answered by BurntSushi
chuanqisun asked this question in Q&A
Discussion options

You must be logged in to vote

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…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@chuanqisun
Comment options

Answer selected by chuanqisun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants