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

2018-09-17 Thread 21naown
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 :

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

2018-09-15 Thread Eric Blake
On 9/15/18 12:57 PM, 21na...@gmail.com wrote: But is it at least possible to find “\x0A\x00” with grep? If you bend the rules by throwing -P into the mix, yes :) 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

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

2018-09-15 Thread Assaf Gordon
Hello, On 15/09/18 11:57 AM, 21na...@gmail.com wrote: Le 15/09/2018 à 19:06, Eric Blake a écrit : On 9/15/18 11:43 AM, 21na...@gmail.com wrote: But is it at least possible to find “\x0A\x00” with grep? If you bend the rules by throwing -P into the mix, yes :) So it is possible to find

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

2018-09-15 Thread 21naown
Le 15/09/2018 à 19:06, Eric Blake a écrit : On 9/15/18 11:43 AM, 21na...@gmail.com wrote: Thank you for your messages. It is possible I did not understand correctly your messages, because grep finds hex sequences with the “-Pa” options at least. grep -P introduces a completely different

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

2018-09-15 Thread 21naown
Thank you for your messages. It is possible I did not understand correctly your messages, because grep finds hex sequences with the “-Pa” options at least. Examples—“input.txt” contains, from the file system, for example

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

2018-09-15 Thread Eric Blake
On 9/15/18 11:43 AM, 21na...@gmail.com wrote: Thank you for your messages. It is possible I did not understand correctly your messages, because grep finds hex sequences with the “-Pa” options at least. grep -P introduces a completely different regex engine, with its own quirks. As such, it

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

2018-09-11 Thread Eric Blake
On 9/11/18 12:14 PM, Paul Eggert wrote: On 9/11/18 10:03 AM, Eric Blake wrote: maybe we really do have a bug - when -z is in effect, I'd expect NUL, rather than newline, to be the byte that separates separate patterns in the pattern argument You're right, I think it's a bug that grep -zf

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

2018-09-11 Thread Paul Eggert
On 9/11/18 10:03 AM, Eric Blake wrote: maybe we really do have a bug - when -z is in effect, I'd expect NUL, rather than newline, to be the byte that separates separate patterns in the pattern argument You're right, I think it's a bug that grep -zf FILE uses newline separators in FILE. It

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

2018-09-11 Thread Eric Blake
On 9/11/18 11:25 AM, 21na...@gmail.com wrote: Hello, I found someone who asked the same question on “Stack Overflow”, still unanswered, but this person did not ask it on the mailing list. Here are the details of the question which are nearly similar to my case:

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

2018-09-11 Thread 21naown
Hello, I found someone who asked the same question on “Stack Overflow”, still unanswered, but this person did not ask it on the mailing list. Here are the details of the question which are nearly similar to my case: