> From: Akim Demaille <[EMAIL PROTECTED]>
> Date: 10 Nov 2000 10:28:29 +0100
> 
> | The POSIX standard says:
> | 
> |    Usually, the matching operator shall return a string representing
> |    the number of characters matched ('0' on failure). Alternatively,
> |    if the pattern contains at least one regular expression
> |    subexpression "[\(...\)]", the string corresponding to "\1" shall
> |    be returned.
> | 
> | This leaves it ambiguous as to what expr 'a' : '\(b\)' should return.
> | One could easily argue that it should be '0'.  But in practice,
> | GNU/Linux and Solaris expr both return the empty string, under the
> | theory that the operation is returning a string.
> 
> Thanks for the information.  May I include as are those two paragraphs
> in the documentation?  In particular are there any license issues wrt
> POSIX snippets?

That quote is small enough so that it would be fair use.  But I would
not quote the POSIX standard directly, as the standard will quite
possibly change.  How about something like this?

The POSIX.2-1996 standard is ambiguous as to whether
expr 'a' : '\(b\)' outputs '0' or the empty string.  In practice, it
outputs the empty string on most platforms, but portable scripts
should not assume this.

Reply via email to