WG15 Defect Report Ref: 9945-2-128
Topic: REs

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


Last update: 1997-05-20



	Topic:                  REs 
	Relevant Sections:      2.8

Defect Report:
	Date: Fri, 30 Jun 1995 00:10:12 -0400 (EDT)
	From: Henry Spencer <henry@zoo.toronto.edu>

I would like to request a formal interpretation on a detail of 9945-2:1993's
regular-expression specs (section 2.8).  (If I'm not following proper
procedure for this, please let me know and I'll resubmit appropriately.)

The standard as written appears to state that "a)b" is a legitimate and
conforming ERE, because right parenthesis is special only in the presence 
of an outstanding unmatched left parenthesis.

This is completely inconsistent with historical practice, which has always
declared an unmatched right parenthesis to be an error.

This change adds no useful functionality, and indeed interferes with
certain significant uses of EREs (which depend on parentheses being
balanced so that user-supplied EREs can safely be embedded in larger ones
by being wrapped in parentheses).

Was this change deliberate, or was this an accidental mistake which
should be corrected?

Should a correction be indicated, the relevant lines in 9945-2:1993 are
3066-3067 and 3221-3222.  A suitable correction would be to delete all
these lines and add right parenthesis to the list of unconditionally-
special characters in line 3062.

                                                           Henry Spencer

Interpretation response

The standard clearly states the behavior for parentheses in regular 
expressions, and conforming implementations must conform to this, even 
if it does not match some historic practices.  However, concerns have 
been raised about this which are being forwarded to the sponsor. 


Forwarded to Interpretations group: Jul 3 1995
Proposed resolution forwarded: Aug 11 1995
Finalized: Sept 12 1995