GNU bug report logs - #71252
why does grep match literal newlines when there are none, even with -z?

Previous Next

Package: grep;

Reported by: Philippe Cerfon <philcerf <at> gmail.com>

Date: Wed, 29 May 2024 01:04:02 UTC

Severity: normal

Tags: notabug

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

Bug is archived. No further changes may be made.

Full log


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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Philippe Cerfon <philcerf <at> gmail.com>
Cc: 71252 <at> debbugs.gnu.org, gnu <at> schrader-schulte.de
Subject: Re: bug#71252: why does grep match literal newlines when there are
 none, even with -z?
Date: Sun, 09 Jun 2024 16:37:59 +0200
On Mai 30 2024, Philippe Cerfon wrote:

> Now GNU grep says "The empty regular expression matches the empty string.".
> Yet it still matches "foo" in the example above, which clearly is not empty.

It matches the empty string *anywhere* in the text.  The match is not
anchored.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."




This bug report was last modified 1 year and 59 days ago.

Previous Next


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