searching for control characters #2578
-
I haven't found a way to search for control characters using hex escapes, specifically I'm looking for \x1f - unit separator - is this possible? note I'm on windows 7 and doing rg <alt 31> works perfectly, however it fails, owing to windows problems, when called from a batch file. I'm thinking something like rg \x31 would work from a batch file. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I don't know what
Note that this is on Linux. The important bit here is that ripgrep recognizes the |
Beta Was this translation helpful? Give feedback.
-
false alarm I'm afraid, looked at the files I was searching with a hex editor and the unit separators have been mangled to utf-8 on insertion :-( |
Beta Was this translation helpful? Give feedback.
I don't know what
rg <alt 31>
means, butrg '\x31'
should work:Note that this is on Linux. The important bit here is that ripgrep recognizes the
\x31
itself as an escape sequence and interprets it as matching the literal byte (in this case)0x31
. You basically just need to be careful that your shell doesn't do something to mangle it. I'm not familiar with Windows shell quoting, so you'll need to figure that out.