emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#22820: closed (grep: Misleading error message when


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#22820: closed (grep: Misleading error message when presenting a badly formed character class)
Date: Fri, 26 Feb 2016 16:50:02 +0000

Your message dated Fri, 26 Feb 2016 08:49:32 -0800
with message-id <address@hidden>
and subject line Re: bug#22820: grep: Misleading error message when presenting 
a badly formed character class
has caused the debbugs.gnu.org bug report #22820,
regarding grep: Misleading error message when presenting a badly formed 
character class
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
22820: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22820
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 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



--- End Message ---
--- Begin Message --- Subject: Re: bug#22820: grep: Misleading error message when presenting a badly formed character class Date: Fri, 26 Feb 2016 08:49:32 -0800
On Fri, Feb 26, 2016 at 6:51 AM,  <address@hidden> wrote:
> 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)."

Thank you for forwarding that.
The diagnostic was fixed in gnulib via a commit last month:
git.savannah.gnu.org/cgit/gnulib.git/commit/?id=7c6e85cf4eccbd5129
Thus, as long as grep is configured --with-included-regex,
you will now see this:

  $ grep -E '[[:digit]]+'
  grep: Unmatched [, [^, [:, [., or [=

If grep is configure with --without-included-regex, you will
still see the inferior diagnostic, but that string will then be
coming from your system's C library.

Since fixing glibc's copy of regcomp.c is outside the scope
of grep's issue tracker, I'm marking this as "done".


--- End Message ---

reply via email to

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