Skip to content

Ripgrep with multiple pattern #1976

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

You must be logged in to vote

No, unfortunately ripgrep does not expose which pattern matched. It's possible this could be added some day, but it is quite a bit of work. There is also API design, since users could reasonably expect different semantics depending on what they're doing. For example, you might want to report all possible matches, even if they're overlapping. Or just report matches in the order in which patterns are given. If a pattern matches, then no other pattern could match at that span.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by BurntSushi
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