9 Commits

Author SHA1 Message Date
Jim Meyering
c635f7dd92 maint: update copyright dates 2026-01-02 16:42:12 -08:00
Paul Eggert
b1eaccd96d maint: update all copyright dates via "make update-copyright" 2025-01-01 19:15:26 -08:00
Paul Eggert
6ee856200a grep: revert recent \d change
I misread the email thread and thought there was consensus
for the \d change, but there was wasn’t so revert the change.
Also, document the resulting confusion
somewhat better than it was documented before.
* src/pcresearch.c, tests/pcre-ascii-digits, tests-pcre-utf8-w:
Revert recent \d change, restoring the behavior to that of grep 3.11.
2024-12-16 14:43:00 -07:00
Paul Eggert
eaca869822 grep: go back to 3.9 -P '\d' behavior
Treating \d differently from Perl was more trouble than it was worth.
* NEWS, doc/grep.texi (grep Programs): Document this.
* src/pcresearch.c (PCRE2_EXTRA_ASCII_BSD):
Remove.  All uses removed.
* tests/pcre-ascii-digits: Adjust to this change.
* tests/pcre-utf8-w: Revert to 3.9.
2024-12-14 14:15:00 -07:00
Jim Meyering
e248db797a maint: update all copyright dates via "make update-copyright" 2024-01-05 09:19:41 -08:00
Paul Eggert
c63a0950ff grep: fix -P [\d] by fixing \w only if PCRE2 10.43
Our prepass-based fixes for the -P \d bug have caused repeated
further bugs.  Avoid the need for a prepass, by using PCRE2_UCP
only if PCRE2_EXTRA_ASCII_BSD is also supported.  Since the -P \w
bug was present from grep 2.5 through 3.8 it’s OK if we wait a
little longer to fix it.
* NEWS: Mention this.
* src/pcresearch.c (pcre_pattern_expand_backslash_d}: Remove.
Remove its use.
(Pcompile): Use PCRE2_UCP only if PCRE2_EXTRA_ASCII_BSD.
* tests/pcre-ascii-digits, tests/pcre-utf8-w:
Skip tests on older PCRE2 implementations.
2023-04-02 09:47:16 -07:00
Paul Eggert
516e855773 maint: spelling fixes 2023-01-16 01:19:41 -08:00
Carlo Marcelo Arenas Belón
8f6a1e90e4 pcre: use UTF only when available in the library
Before this change, if linked with a PCRE library without unicode
any invocations of grep when using a UTF locale will error with:

  grep: this version of PCRE2 does not have Unicode support

* src/pcresearch.c: Check whether Unicode was compiled in.
* tests/pcre-utf8-w: Add check to skip test.
* tests/pcre-utf8: Update check.
2023-01-11 10:24:09 -08:00
Carlo Marcelo Arenas Belón
5e3b760f65 pcre: use UCP in UTF mode
This fixes a serious bug affecting word-boundary and word-constituent regular
expressions when the desired match involves non-ASCII UTF8 characters.
* src/pcresearch.c: Set PCRE2_UCP together with PCRE2_UTF
* tests/pcre-utf8-w: New file.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Bug fixes): Mention this.
* THANKS.in: Add Gro-Tsen and Karl Petterson.
Reported by Gro-Tsen https://twitter.com/gro_tsen/status/1610972356972875777
via Karl Pettersson in https://github.com/PCRE2Project/pcre2/issues/185
This bug was present from grep-2.5, when --perl-regexp (-P) support was added.
2023-01-07 18:24:51 -08:00