GNU bug report logs - #62605
`[\d]` does not work with PCRE

Previous Next

Package: grep;

Reported by: Tukusej’s Sirs <tukusejssirs <at> protonmail.com>

Date: Sun, 2 Apr 2023 04:48:02 UTC

Severity: normal

Tags: patch

Merged with 60690, 62552

Full log


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

From: Tukusej’s Sirs <tukusejssirs <at> protonmail.com>
To: "bug-grep <at> gnu.org" <bug-grep <at> gnu.org>
Subject: `[\d]` does not work with PCRE
Date: Sat, 01 Apr 2023 21:32:24 +0000
[Message part 1 (text/plain, inline)]
Hi, everyone,

I have just noticed that `grep -P '[\d]' <<< 'asdf 1234 asdf'` does not work, while `grep -P '[0-9]' <<< 'asdf 1234 asdf'` works as expected. When `\d` is used outside of square brackets, it works as expected.
I have no idea why `[\d]` does not work, but after I open this SO question, it seems to be a problem at least in `grep <at> 3.10` or `3.7+` (excluding `3.7`).
Note that I use Arch Linux and I have installed `grep` from the official repositories.
`grep` version I currently use:

    grep (GNU grep) 3.10
    Copyright (C) 2023 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    

    Written by Mike Haertel and others; see
    <https://git.savannah.gnu.org/cgit/grep.git/tree/AUTHORS>.


How this helps someone to find the bug in the code. :)

Tukusej’s Sirs
[Message part 2 (text/html, inline)]
[publickey - [email protected] - 0x3FEA1A6D.asc (application/pgp-keys, attachment)]
[signature.asc (application/pgp-signature, attachment)]

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

Previous Next


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