GNU bug report logs - #22820
grep: Misleading error message when presenting a badly formed character class

Previous Next

Package: grep;

Reported by: santiagorr <at> riseup.net

Date: Fri, 26 Feb 2016 14:52: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: santiagorr <at> riseup.net
To: 22820 <at> debbugs.gnu.org
Subject: bug#22820: grep: Misleading error message when presenting a badly formed character class
Date: Fri, 26 Feb 2016 15:51:18 +0100
Hi,

I'd like to forward a bug filled by Gunnar Wolf in Debian some time
ago:

"It seems that whenever egrep finds something it cannot digest inside a
character class, it spews out the same error string: «Unmatched [ or [^».
This can be misleading and opens the way for long debugging time,
specially when trying to understand complex regexes. To illustrate the
point:

$ echo | egrep -v '[[:digit]]+'
egrep: Unmatched [ or [^

The brackets _are_ balanced, however the character class is not (it
lacks a finishing colon)."

Thanks,

Santiago




This bug report was last modified 9 years and 85 days ago.

Previous Next


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