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
By default, patterns are Unicode aware, so all escape sequences identify the codepoint to search for, which is not the same as the byte to search for. To search for a raw byte, you need to disable Unicode. For example, (?-u:\xa7) should do what you want. This is documented in the syntax docs linked from the man page.
The error message is indeed wrong, or at least, incomplete.
When a pattern with invalid UTF-8 is given, the error message suggests
unqualified use of hex escape sequences to match arbitrary bytes. But
you *also* need to disable Unicode mode. So include that in the error
message.
Fixes#1339
What version of ripgrep are you using?
ripgrep 11.0.1 (rev 1f1cd9b)
-SIMD -AVX (compiled)
+SIMD +AVX (runtime)
How did you install ripgrep?
GitHub deb, I think
What operating system are you using ripgrep on?
Ubuntu 18.04
Describe your question, feature request, or bug.
grep finds arbitrary bytes within a binary file, but ripgrep does not.
If this is a bug, what are the steps to reproduce the behavior?
If this is a bug, what is the actual behavior?
If this is a bug, what is the expected behavior?
Either ripgrep should be able to search for arbitrary bytes, or it should not print a message implying that it can do so:
The text was updated successfully, but these errors were encountered: