bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#32704: Can grep search for a line feed and a null character at the s


From: 21naown
Subject: bug#32704: Can grep search for a line feed and a null character at the same time?
Date: Mon, 17 Sep 2018 17:56:52 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

Hello Assaf.

Thank you Assaf and Eric for your suggestions. I will also look at the tool “pcregrep”.

--------------------------------------------------------------------------------

Thank you Eric for having answered the question of the subject:

Le 15/09/2018 à 22:27, Eric Blake a écrit :
On 9/15/18 12:57 PM, address@hidden wrote:

So it is possible to find “\x0A\x00” alone, but for example “\x74\x00\x0D\x00\x0A\x00\x74\x00\x65\00” is impossible to find with the “-P” option?

Correct. It is impossible to find the record terminator in the middle of a pattern, whether that terminator is \n (default) or NUL (-z).  It is therefore impossible to find a multi-record match using grep.  The string you listed contains both \x00 and \x0a, so regardless of which of those two bytes you pick as the record terminator, it is impossible to use grep to find that substring in your file.  You'll have to resort to a tool that supports multiline matching, since grep is not such a tool.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]