* Peter Moulder <peter.moul...@infotech.monash.edu.au>, 2008-04-10, 16:56:
The initial m is mandatory in Single Unix Spec too, to judge from
http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html .
To be exact: {,n} produces undefined results. That is, GNU grep is allowed to support it, while still preserving conformance to POSIX.

I don't know whether or not {,n} was allowed by earlier versions of GNU
grep [update: see below], but I would guess that it's deliberately not
allowed by current GNU grep, to promote portability among other POSIX
regular expression implementations.

Thus, I suggest simply removing mention of {,n} from the documentation,
and noting in the documentation of {m,n} that m is not optional.

OK, I've just checked the changelog: the 1999-10-02 entry mentions
"Remove (broken) support for {,M} meaning {0,M}."
But the documentation for {,n} was (re?)introduced much later...
http://savannah.gnu.org/patch/?4610

What is more, grep behaves inconsistently with respect to {,m}:

$ echo 'ab{,2}c' | grep -E 'ab{,2}c' | wc -c
8

$ echo 'ab{,2}c' | grep -E -o 'ab{,2}c' | wc -c
0

--
Jakub Wilk



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to