.
Last update: 1997-05-20
9945-2-21
Class: Editorial defect
_____________________________________________________________________________
Topic: sh
Relevant Sections: 3.13.1
Defect Report:
-----------------------
In Section 3.13.1 - Patterns Matching a Single Character,
the standard states that ``special characters can be escaped
to remove their special meaning by preceding them with a
<backslash>.'' [Draft 12 of ISO/IEC 9945-2:1993 (July
1992), p. 157, lines 1397-1399] The standard defines these
``special characters'' to be ``?,'' ``*,'' and ``[.''
[Ibid., p. 157, lines 1386-1389]
Thus, it appears that special characters within [] are not
within the scope of the statement on lines 1397-1399. Thus,
the statement in Section 2.8.3.2, ``[t]he special characters
. * [ \ (period, asterisk, left-bracket, and backslash,
respectively) shall lose their special meaning within a
bracket expression'' [Ibid., pp 82-83. lines 2892-2895],
presumably holds.
This implies to me that the pattern bracket expression
``[a\-z]'' should match the letter a, and <backslash>
through z, as it does in regular expressions. This
disagrees with historical practice, where this pattern
matches a, -, and z. Is the intent to disable historical
practice, or can we interpret lines 1397-1399 as reading
``... special characters, including special characters
within a pattern bracket expression?''
WG15 response for 9945-2:1993
-----------------------------------
The standard is specific in its requirement that RE behavior apply to
bracket expressions with the one noted exception. The example in the
request does not fulfill this exception, hence it must be interpreted
according to the RE rules (2.8.3.2). Concern over the wording of this
section has been forwarded to the Sponsors of the standard.
Rationale for Interpretation:
-----------------------------
None.
_____________________________________________________________________________