GNU bug report logs -
#72246
Possible PCRE bug in grep 3.11
Previous Next
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Grep 3.11 doesn't seem to behave as expected with some range-based PCREs.
See attached minimal example, comparing grep 3.11 to pcregrep 8.45.
(The latter behaves as I had thought 'grep -P' ought to, but maybe
I'm wrong on that.)
This may be related to
https://lists.gnu.org/archive/html/grep-devel/2023-03/msg00017.html
which references a regression in 3.10.
Figured it was worthwhile to report even it may be a duplicate.
Version info: Arch64 linux, kernel 6.1.68, commodity x86-64 laptop.
- Glenn Golden
========================== BEGIN INLINE ATTACHMENT =========================
#!/usr/bin/bash
#
# String containing 3 octets >= 0x80:
#
str=$(printf "begin\xe2\x80\x99end")
#
# grep 3.11 using PCRE '[\x80-\xFF]' doesn't find any of them,
# and exits with 1, indicating no match.
#
printf "Using grep 3.11:\n"
printf "${str}\n" | grep --color=auto -P -e '[\x80-\xFF]'
printf "exit value = $?\n";
printf "\n"
#
# pcregrep 8.45 behaves as I thought 'grep -P' ought to:
#
printf "Using pcregrep 8.45:\n"
printf "${str}\n" | pcregrep --color=auto -e '[\x80-\xFF]'
printf "exit value = $?\n";
========================== END INLINE ATTACHMENT =========================
This bug report was last modified 330 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.