The initial m is mandatory in Single Unix Spec too, to judge from
http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html .

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}."  The NEWS entry for
v2.4 correspondingly says:

  - The lower bound of an interval is not optional.
    You must use an explicit zero, e.g. `x{0,10}' instead of `x{,10}'.
    (The old documentation incorrectly claimed that it was optional.)

It's still a little unclear to me from those descriptions how `x{,n}'
was handled in earlier versions, but even if it did previously handle
`x{,n}' as equivalent to `x{0,n}', I'd still be inclined not to mention
this historical detail in the current man page.


Another couple of notes now that I've looked at that Single Unix Spec
page:

The paragraph mentioning \<, \>, \b, \B, \w and \W might add `These are
GNU extensions; the behaviour of these sequences is explicitly
unspecified by the Single Unix specification of regular expressions.' or
simply `(These are GNU extensions.)'.

I also note that the current man page doesn't mention collating symbol
expressions (`[.ch.]' inside a bracket expression) or equivalence class
expressions (`[=C=]' inside a bracket expression).  I haven't checked
whether either of these are implemented, but I think they should be
mentioned whether they are implemented (even if only with a request for
documentation to be added) or unimplemented ("Note: ... are not yet
implemented") or implementation status is unknown ("Note: The Single
Unix specification of ... mentions ..., but the author of this man page
is unaware of their implementation status in GNU grep.  Please consider
[sending such documentation to the appropriate place].").


pjrm.



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to