Suggest -U when regex contains \n
dtolnay opened this issue · 1 comments
dtolnay commented
What version of ripgrep are you using?
ripgrep 0.10.0
-SIMD -AVX (compiled)
+SIMD +AVX (runtime)
How did you install ripgrep?
cargo install
Describe your question, feature request, or bug.
I tried this regex today: rg '=> \{\n *break;'
. The output is:
the literal '"\n"' is not allowed in a regex
I would expect this error to suggest passing -U
to enable multiline mode, in which that pattern would be allowed.
BurntSushi commented
This seems like a good idea! We already do the same with the -P
flag if look-around or backreferences are used.