[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#60690: -P '\d' in GNU and git grep

From: Paul Eggert
Subject: bug#60690: -P '\d' in GNU and git grep
Date: Sat, 8 Apr 2023 15:45:20 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0

On 2023-04-07 22:01, Carlo Arenas wrote:

Not sure I follow the whole logic here, but PCRE2[3] (search for
"general category" which is what the "gc" above stands for) only
supports the abbreviated form of the unicode classes and `Nd` is
indeed the one that corresponds to `Decimal_Number`.

That's fine: all that UTS#18[1] requires is that PCRE2 provide syntax for a regular expression that matches the Decimal Number class. Which PCRE2 does, via \p{Nd}.

The logic is that UTF#18 does not require that \d must behave like \p{Nd}, or even that \p{gc=Decimal_Number} must behave like \p{Nd}. It merely requires that there be some syntax for matching Decimal Number, and it says the choice of syntax is up to the implementer. This is why UTF#18 doesn't require that \d must also match non-ASCII digits (which is what I think Yves was saying).

[1]: https://unicode.org/reports/tr18/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]