GNU bug report logs - #22655
grep-2.21 (and git master): --null-data and ranges work in an odd way (-P works fine)

Previous Next

Package: grep;

Reported by: Sergei Trofimovich <slyfox <at> gentoo.org>

Date: Sat, 13 Feb 2016 23:24:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #73 received at 22655 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Stephane Chazelas <stephane.chazelas <at> gmail.com>
Cc: 22655 <at> debbugs.gnu.org
Subject: Re: bug#22655: grep -Pz '^' now fails!
Date: Fri, 18 Nov 2016 09:47:50 -0800
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.




This bug report was last modified 8 years and 190 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.