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
I guess this is because $ still only matches \n and EOS with --null-data. You can confirm this easily by looking at what matches are highlighted when you search for a pattern containing $ (the <...> here represent the matches):
Maybe it's been addressed before and i just don't remember, but it does seem like the GNU behaviour is more intuitive/useful. That's how i assumed it worked, at least
I'm going to mark this at wontfix for now. Fixing this correctly probably means adding a configurable knob to the regex engine to permit setting the line terminator recognized by ^ and $. I've filed an issue for that: rust-lang/regex#644
If that ever gets fixed, then we could have ripgrep enable it whenever --null-data is enabled.
(GNU grep's DFA implementation takes this route as well. It can be configured to have \0 be a line terminator.)
What version of ripgrep are you using?
ripgrep 11.0.2
-SIMD -AVX (compiled)
+SIMD +AVX (runtime)
How did you install ripgrep?
cargo install ripgrep
What operating system are you using ripgrep on?
Linux username 5.3.0-28-generic #30~18.04.1-Ubuntu SMP Fri Jan 17 06:14:09 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Sample of reproducing the bug:
What I tried to do:
bad output
How I expect it to work
This does work fine. (note replaced \0 with \n, and removed null command line args)
good output
The text was updated successfully, but these errors were encountered: