You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's possible to turn case sensitivity (and presumably other modes) on and off using inline modifiers, but this doesn't extend to multiline mode "(?m)".
If this is a bug, what are the steps to reproduce the behavior?
the literal '"\n"' is not allowed in a regex
Consider enabling multiline mode with the --multiline flag (or -U for short).
When multiline mode is enabled, new line characters can be matched.
N.B. It's not possible to disable multiline mode via inline modifiers either. Eg:
rg -U "(?-m)RIP\nGREP" corpus.txt
Output:
2:RIP
3:GREP
When you wouldn't expect a match.
If this is a bug, what is the actual behavior?
See above for output. Multiline mode cannot be enabled or disabled using inline modifiers.
If this is a bug, what is the expected behavior?
ripgrep to read the inline modifiers and enable or disable multiline mode for the relevant parts of the provided pattern as directed.
The text was updated successfully, but these errors were encountered:
ripgrep's multiline mode is not the same as regex multiline mode. The former just allows patterns to match over multiple lines. The latter just makes anchors match at line boundaries (which is enabled by default for all searches, regardless of whether ripgrep's multiline mode is enabled or not). They are entirely orthogonal options.
What version of ripgrep are you using?
ripgrep 11.0.1 (rev e7829c0)
-SIMD -AVX (compiled)
+SIMD -AVX (runtime)
How did you install ripgrep?
Compiled from source
What operating system are you using ripgrep on?
Arch Linux
Describe your question, feature request, or bug.
It's possible to turn case sensitivity (and presumably other modes) on and off using inline modifiers, but this doesn't extend to multiline mode "(?m)".
If this is a bug, what are the steps to reproduce the behavior?
Create the following corpus.txt:
With PCRE2 engine:
Output (blank - see bug #1261):
With Rust's engine:
Output:
N.B. It's not possible to disable multiline mode via inline modifiers either. Eg:
Output:
When you wouldn't expect a match.
If this is a bug, what is the actual behavior?
See above for output. Multiline mode cannot be enabled or disabled using inline modifiers.
If this is a bug, what is the expected behavior?
ripgrep to read the inline modifiers and enable or disable multiline mode for the relevant parts of the provided pattern as directed.
The text was updated successfully, but these errors were encountered: