bug-grep
[Top][All Lists]
Advanced

[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: Wed, 5 Apr 2023 13:03:51 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0

On 2023-04-05 12:40, Jim Meyering wrote:
(C)  preserve grep -P's tradition of \d matching only 0..9, and once
grep uses 10.43 or newer, \b and \w will also work as desired.

If I understand you correctly, (C) would mean that GNU grep -P, git grep -P, and pcre2grep -u would all use PCRE2_UTF | PCRE2_UCP, and would also use the extra option PCRE2_EXTRA_ASCII_BSD that is planned for 10.43 PCRE2.

This would require changes to bleeding-edge pcre2grep -u (since it would need to add PCRE2_EXTRA_ASCII_BSD unless --no-ucp is also given), and to git grep -P (which would need to add PCRE2_UCP and PCRE2_EXTRA_ASCII_BSD, when libpcre2 is new enough to #define PCRE2_EXTRA_ASCII_BSD).

This option works for me as well. In fact it's the least work for me since I already implemented it in bleeding-edge GNU grep (so it works this way already :-).






reply via email to

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