-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
multiline search for simple cases #360
Comments
I don't understand the feature request. I don't know what Tip: consider reusing the |
FWIW, I am personally sympathetic to the idea of running regexes against the context of a match (but where each individual regex can still only match in a single line). That is certainly feasible to do in a way that true multiline search is not. However, it is still a significant addition in terms of implementation. Please also keep in mind that I am very against a complicated UX. A complicated UX is one with lots of knobs that only implementors understand. |
yes, that's the case
and then parse output looking for
|
Parseable output is here: #244 --- Having that return the index of the regex that matched is not going to happen, since, in the current implementation, that would have a big performance hit. Overall, I find the feature proposed here to be way too complicated. It doesn't reuse existing flags (like Your needs would be better met by writing code. |
even though ripgrep is line oriented and full multiline search is sadly out of question (after reading #176), supporting simple cases would be very useful, eg:
full description
--multiline=[unordered|ordered] --window_size=N [--pattern $regex_i ...]
will return a list of matches
file:line
such that:with --unordered:
with --ordered:
--window_size=N
represents the context to search for the K matches. When unspecified, N defaults to infinity (ie all patterns must occur infile
fromline
toend of file
When only a single pattern is used, it has same behavior as standard
rg
Examples
foo.d
:The text was updated successfully, but these errors were encountered: