Allow -o, --only-matching work together with -r, --replace #593
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello!
Thank you for your amazing work on much-needed and super-fast fully-featured regex search utility which is
ripgrep
.However I’ve been missing a bit a feature similar to ack’s helpful
--output
which allows printing only certain capture groups. That feature is discussed in #320 and the discussion offers a solution. However it requires matching an entire line, which still might seem a bit less straightforward for some users.Now, there is probably a reason why
-o
is made to conflict with-r
so please excuse me if this PR is really out-of-place. However after implementing it, upon superficial gaze, things seem to be working fine:Examples outputs
ripgrep
ack
So I hope this has a chance of being considered. Thank you again!