|
From: | Paul Eggert |
Subject: | bug#22655: grep -Pz '^' now fails! |
Date: | Sat, 19 Nov 2016 00:36:12 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
Stephane Chazelas wrote:
one can use (?m) if he wants ^ to match the beginning of each line in the NUL-delimited record instead of just the beginning of the record.
I think the intent is that ^ and $ should match only the line-terminator specified by -z (or by -z's absence). So the sort of usage you describe is unspecified and not supported. That being said, it does make sense to match tricky regular expressions like that line by line, even if this hurts performance. Otherwise, I suspect there are even trickier regular expressions that could reject a buffer full of lines even though it contains matching lines. When in doubt we should avoid optimization so I installed the attached patch into the master branch. Please give it a try.
0001-grep-Pz-no-longer-rejects.patch
Description: Text Data
[Prev in Thread] | Current Thread | [Next in Thread] |