bug-grep
[Top][All Lists]
Advanced

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

bug#39678: 'grep --ignore-case --color' does not always color the matche


From: Tomasz Dziendzielski
Subject: bug#39678: 'grep --ignore-case --color' does not always color the matches
Date: Mon, 18 Oct 2021 06:53:01 +0200

>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

pon., 18 paź 2021 o 06:08 Paul Eggert <eggert@cs.ucla.edu> napisał(a):

> On 10/17/21 15:15, Tomasz Dziendzielski wrote:
> > It's being printed even when re_search in EGexecute doesn't return a
> match.
>
> Gexecute should return a match, though, right? This is because the
> pattern '\a' matches the data 'a'. So it sounds like the bug is in
> EGexecute somewhere, not in its caller.
>


reply via email to

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