# WG15 Defect Report Ref: 9945-2-125 Topic: Basic Regukar expressions

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

.

Last update: 1997-05-20

```								9945-2-125

_____________________________________________________________________________

Topic:                  Basic Regukar expressions
Relevant Sections:      2.8.3.3

Defect Report:
-----------------------
Date: Fri, 19 May 1995 14:40:59 -0700
From: Greg Burrell <greg@mindcraft.com>

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

Section 2.8.3.3 (lines 2994-3010) describe interval expressions in
Basic Regular Expressions:

(5) when a BRE matching a single character, a subexpression,
or a backreference is followed by an interval expression
of the format \{m\}, \{m,\}, or \{m,n\}, it shall match
(together with that interval expression) what repeated
consecutive occurrences of the BRE would match.  The
values of m and n shall be decimal integers in the range

0 <= m <= {RE_DUP_MAX}

where m specifies the exact of minimum number of
occurrences and n specifies the maximum number of
occurrences.

When the interval is \{0,0\} what does it mean to match zero occurrences of
the preceding BRE?  Does this mean match the empty string or match the BRE
plus an additional zero occurrences?  For example,

BRE="([a-c]*)\{0,0\}"
input="abcd"

Will this match before the first 'a' character?  Or will it match the
entire "abc" portion?  Or will something else occur?

Thank you for your attention to this matter.

Sincerely,
Greg Burrell
Mindcraft, Inc.
greg@mindcraft.com
+1 415 323-9000 x125

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

Parentheses are not grouping characters in a BRE.  Assuming that what was
intended was BRE="\([a-c]*\)\{0,0\}" then a literal reading of the
text would say that this expression is equivalent to the null regular
expression.  The meaning of the null regular expression is not specified
by the standard, and as such no conformance distinction can be made
between alternative implementations based on this.  This is being referred