GNU bug report logs - #54043
Simple regexp bug [contains spoiler for today's wordle]

Previous Next

Package: grep;

Reported by: Matthew Wilcox <willy <at> infradead.org>

Date: Thu, 17 Feb 2022 14:51:02 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Matthew Wilcox <willy <at> infradead.org>
To: 54043 <at> debbugs.gnu.org
Subject: bug#54043: Simple regexp bug [contains spoiler for today's wordle]
Date: Thu, 17 Feb 2022 14:47:04 +0000
I noticed this one while doing:

$ grep sha[^s]e five-letter-words
share

which doesn't fit with:

$ grep sha.e five-letter-words
shade
shake
shale
shame
shape
share
shave

A reproducer is easy:

$ echo shame |grep sha[^s]e
(no output)

Almost any change to the regex & input will make it work, even rot-13
of both.  For example:

$ echo shamel |grep sha[^s]e
(no output, still fails)
$ echo shamel |grep sha[^s]el
shamel
$ echo sshame |grep ssha[^s]e
sshame
$ echo funzr |grep fun[^f]r
funzr

$ grep --version
grep (GNU grep) 3.7
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and others; see
<https://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.

This is Debian amd64, grep package version 3.7-1.




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

Previous Next


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