GNU bug report logs - #39678
'grep --ignore-case --color' does not always color the matches

Previous Next

Package: grep;

Reported by: Benno Schulenberg <bensberg <at> telfort.nl>

Date: Wed, 19 Feb 2020 15:28:01 UTC

Severity: normal

Merged with 51255, 51256, 51257

Full log


View this message in rfc822 format

From: Tomasz Dziendzielski <tomasz.dziendzielski <at> gmail.com>
To: 39678 <at> debbugs.gnu.org
Subject: bug#39678: Fwd: 'grep --ignore-case --color' does not always color the matches
Date: Mon, 18 Oct 2021 06:44:48 +0200
[Message part 1 (text/plain, inline)]
Hi,
sorry for producing such a spam, there was huge 7h delay between my mail
and the reply from the mailing list, so I thought something was not sent
correctly on my side.

>EGexecute should return a match, though,
>right? The pattern '\a' matches
>the data 'a'. So the bug is in EGexecute >somewhere, not in its caller.
Thanks for the reply. In my opinion the bug is not in the EGexecute, since
it uses re_search (from gnulib) and the re_search is not returning a match.
So there is no problem in EGexecute. I also compared python re.search with
\a also don't return a match and I found \a can be interpreted a bell or
alarm.
It's good to mention that the lack of match happens for all lowercase
characters that are not defined in regex (for example echo "j" | grep -i
--color '\j'. Comparing to python, they don't allow us to escape any
incorrect lowercase characters, for example:
>>>re.search("\j","j", re.IGNORECASE)
re.error: bad escape \j at position 0
Due to that I think grep should also ignore the non-maching/bad character
instead of printing them.

Best regards,
Tomasz Dziendzielski
[Message part 2 (text/html, inline)]

This bug report was last modified 3 years and 23 days ago.

Previous Next


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