GNU bug report logs - #16865
grep -wP and backreferences

Previous Next

Package: grep;

Reported by: Stephane Chazelas <stephane.chazelas <at> gmail.com>

Date: Mon, 24 Feb 2014 16:31:02 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


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

From: Jim Meyering <jim <at> meyering.net>
To: Stephane Chazelas <stephane.chazelas <at> gmail.com>
Cc: 16865 <at> debbugs.gnu.org
Subject: Re: bug#16865: grep -wP and backreferences
Date: Mon, 24 Feb 2014 12:00:08 -0800
[Message part 1 (text/plain, inline)]
On Mon, Feb 24, 2014 at 2:01 AM, Stephane Chazelas
<stephane.chazelas <at> gmail.com> wrote:
> Hello,
>
> Backreferences don't work with -w or -x in combination with -P:
>
> $ echo aa | grep -Pw '(.)\1'
> $
>
> Or they work in an unexpected way:
>
> $ echo aa | grep -Pw '(.)\2'
> aa
>
> The fix is simple:
>
>
> --- src/pcresearch.c~   2014-02-24 09:59:56.864374362 +0000
> +++ src/pcresearch.c    2014-02-24 07:33:04.666398105 +0000
> @@ -75,9 +75,9 @@ Pcompile (char const *pattern, size_t si

Thanks a lot for the patch.
I've converted it to a proper commit with NEWS and a test case.
Please ack the attached if it's all ok with you (you're still the "Author:"):
[k.txt (text/plain, attachment)]

This bug report was last modified 11 years and 90 days ago.

Previous Next


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