WG15 Defect Report Ref: 9945-2-120
Topic: expr


This is an approved interpretation of 9945-2:1993.

.

Last update: 1997-05-20


								9945-2-120

 _____________________________________________________________________________

	Topic:			expr
	Relevant Sections:	4.22.7.1


Defect Report:
-----------------------

	Date: Tue, 2 May 1995 15:17:17 -0700
	From: Greg Burrell <[email protected]>


Defect Report:
-----------------------

I would like to request an official, binding interpretation from
WG15 concerning the following point in ISO/IEC 9945-2:1993 (POSIX.2).

Subclause 4.22.7.1 of POSIX.2 specifies the syntax and semantics of
the expr utility.  This section reads:

	The ':' matching operator shall compare the string
	resulting from the evaluation of expr1 with the BRE
	pattern resulting from the evaluation of expr2. BRE
	syntax shall be that defined in 2.8.3, except that
	all patterns are "anchored" to the beginning of the
	string (that is, only sequences starting at the first
	character of a string shall be matched by the BRE).
	Therefore, it is unspecified whether ^ is a special
	character in that context.

Note that this description does not say that it is "implementation defined",
but rather "unspecified" whether ^ is an anchor when used in the BRE of an
expr matching expression.  As such, this implies that a conforming
implementation of expr need not even behave consistently from one invocation
to the next when a ^ is used in a BRE on the right side of a ':' operator.  
Since the BRE is not a subexpression, the system defined behavior of anchors
in subexpressions does not apply here.  Is this the intention?

Thank you for your attention to this matter.

Sincerely,
Greg Burrell
Mindcraft, Inc.
[email protected]
+1 415 323-9000 x125


Interpretation response
------------------------

It is difficult to state what the intention was, but the standard is 
clear.   If "implementation defined" were used instead of "unspecified",
it would not affect a conforming POSIX.2 application.


Rationale
-------------
None.

Forwarded to Interpretations group: May 04 1995
Proposed resolution forwarded: Aug 11 1995
Finalized: Sept 12 1995