WG15 Defect Report Ref: 9945-2-82
Topic: BRE


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

.

Last update: 1997-05-20


								9945-2-82

 _____________________________________________________________________________

	Topic:			BRE
	Relevant Sections:	2.8.3


Defect Report:
-----------------------
Date: Fri, 7 Oct 1994 15:25:05 -0700
From: Fred Zlotnick <[email protected]>

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

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

POSIX.2 Subclause 2.8.3.3 item (3) specifies the semantics of
backreference expressions in Basic Regular Expressions.  This section
states in part:

	The backreference expression \n shall match the same (possibly
	empty) string of characters as was matched by a subexpression
	enclosed between \( and \) preceding the \n.

Suppose that the subexpression includes an anchor, and suppose that the
system in question is one on which anchoring characters act as anchors
in subexpressions.  Does the backreference expression have to match an
anchored string?  (In this case, it can never match anything unless the
first subexpression matched an empty string.)  For example, on such a
system does the BRE

	\(^b\)\1

match the first two characters of

	bbbbb

or is the BRE to be treated as equivalent to

	\(^b\)\(^b\)

(in which case it will not match)?

Thank you for your attention to this matter.

Interpretation response:
-------------------------



The standard clearly states the behaviour for BREs, and conforming 
implementations must conform to this.
 
In the example provided, the standard permits matching, but does not require
it.


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

Forwarded to Interpretations group: 09 Oct 94

Proposed resolution sent for review: 19th Nov 94
Resolved: 10th Dec 94