|
From: | Paul Eggert |
Subject: | bug#22655: grep -Pz '^' now fails! |
Date: | Fri, 18 Nov 2016 09:47:50 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
Stephane Chazelas wrote:
$ time grep -Pz '(?-m)^/' ~/a > /dev/null
It looks like you want "^" to stand for a newline character, not the start of a line. That is not how grep -z works. -z causes the null byte to be the line delimiter, and "^" should stand for a position immediately after a null byte (or at start of file).
It might be nice to have a syntax for matching a newline byte with -z (or a null byte without -z, for that matter). But that would be a new feature.
[Prev in Thread] | Current Thread | [Next in Thread] |