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
Since there's no way to pass a NULL character on the command-line, this needs to be done via the tool's ability to read a pattern from a file. Not all matchers can do this.
GNU grep can do it:
$ perl -wE 'say "foo\0bar"' >file; perl -wE 'say "f.*\0[b].*a"' >p; grep -a -f p file; echo $?
foobar
0
Note that some matchers look like they can do it, but they just discard anything on the RHS of the \0, e.g. pcre2grep (even though pcre2 itself supports this):
$ perl -wE 'say "foo\0bar"' >file; perl -wE 'say "f.*\0[x].*a"' >p; ./pcre2grep -a -f p file; echo $?
foobar
0
This match should fail, but doesn't. GNU grep is not fooled by this.
The text was updated successfully, but these errors were encountered:
Since there's no way to pass a NULL character on the command-line, this needs to be done via the tool's ability to read a pattern from a file. Not all matchers can do this.
GNU grep can do it:
Note that some matchers look like they can do it, but they just discard anything on the RHS of the \0, e.g. pcre2grep (even though pcre2 itself supports this):
This match should fail, but doesn't. GNU grep is not fooled by this.
The text was updated successfully, but these errors were encountered: