GNU bug report logs - #62267
grep-3.9 bug: \d matches multibyte digits

Previous Next

Package: grep;

Reported by: Jim Meyering <jim <at> meyering.net>

Date: Sun, 19 Mar 2023 00:07:01 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jim Meyering <jim <at> meyering.net>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 62267 <at> debbugs.gnu.org
Subject: bug#62267: grep-3.9 bug: \d matches multibyte digits
Date: Sat, 18 Mar 2023 23:33:33 -0700
[Message part 1 (text/plain, inline)]
On Sat, Mar 18, 2023 at 10:54 PM Jim Meyering <jim <at> meyering.net> wrote:
> On Sat, Mar 18, 2023 at 5:39 PM Paul Eggert <eggert <at> cs.ucla.edu> wrote:
> > Thanks for looking into this. A couple of questions.
> >
> > First, some documentation issues. Why is PCRE2 incompatible with Perl on
> > this issue? Are there other areas where the two are incompatible?
>
> To be honest, I was not too concerned about keeping up with Perl
> and am not worried about divergence, but admit I do not like the
> implication, given the name of the option: --perl-regexp. It's always
> been "pcre-regexp" in spirit. I suppose we'll want to document that,
> eventually.
>
> > Are
> > these incompatibilities documented anywhere? Is the goal for 'grep -P'
> > to be compatible with Perl, not with PCRE2?
>
> Doesn't Perl have the same issue?
> That's why the /a and /aa match modifiers were added.
>
> > Second, although that patch focuses on \d, doesn't \D have a similar
> > problem and shouldn't it be fixed too?
>
> Good point about \D. Will adjust.

Here's an additional patch to handle \D. I've only just written it, so
it's probably wrong or incomplete somewhere. I'll review it properly
and probably improve it (could certainly add more tests in this area)
tomorrow.

By the way, have you ever used \D? I think I have not.
[grep-multibyte-D.patch (application/octet-stream, attachment)]

This bug report was last modified 2 years and 143 days ago.

Previous Next


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