I've just tweaked the documentation and pushed this:
From adf0bf94a10d40f39d72663878a245163232aae6 Mon Sep 17 00:00:00 2001
From: Jim Meyering<address@hidden>
Date: Tue, 31 Aug 2010 21:14:41 +0200
Subject: [PATCH 1/2] grep: diagnose and exit-2 for bogus REs like [:space:],
[:digit:], etc.
When I make a mistake like this:
grep '[:lower:]' ...
be it in a script or on the command line, I want to know about
it as soon as possible. I don't want grep to print a mere warning
that it is interpreting this suspicious and almost guaranteed-wrong
regular expression as a set of just 6 bytes. And I certainly don't
want grep to silently do the wrong thing, even if that would be
officially standards-conforming. It's obvious that I intended
[[:lower:]], and I want my error to be diagnosed in a way that is
most likely to get my attention. Thus, with this change, grep now
prints a diagnostic and exits with status 2 the moment it
encounters an offending [:char_class:] construct.
This changes the way grep works by default, rather than
putting this new behavior on an option. A new option
would seldom be used in scripts (not portable), and would
probably be used only rarely by those who need it the most.
This new functionality provides a valuable safety measure
and incurs truly negligible risk.
For strict POSIX compliance, set POSIXLY_CORRECT in
your environment. That disables this new feature.
Revert the changes from commit 2cd3bcea, "grep: add
--warnings={always,never,auto}.", and then do the following: