GNU bug report logs - #33062
grep matches too lazily when invoked with -zoP and matching backreference followed by newline

Previous Next

Package: grep;

Reported by: Johannes Riecken <johannes.riecken <at> gmail.com>

Date: Tue, 16 Oct 2018 14:42: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 #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Johannes Riecken <johannes.riecken <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: grep matches too lazily when invoked with -zoP and matching
 backreference followed by newline
Date: Tue, 16 Oct 2018 14:55:34 +0200
[Message part 1 (text/plain, inline)]
Dear maintainers:

*Bug summary: *GNU grep 3.0-2 matches too lazily when invoked with -zoP and
matching backreference followed by newline

*Steps to reproduce:*

Create file cases:

foo
bar
  cases:
    1: foo
    2: bar
baz
  cases:
    3: baz
quux

And run grep -zoP '(\s*)cases:\n(\1.*\n)*' cases

*Expected output:*

  cases:
    1: foo
    2: bar
  cases:
    3: baz

* Actual output:*

  cases:

  cases:

Best regards,

Johannes Riecken
[Message part 2 (text/html, inline)]

This bug report was last modified 5 years and 201 days ago.

Previous Next


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