WG15 Defect Report Ref: 9945-2-130
Topic: awk - escape sequences in ERE constants

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


Last update: 1997-05-20



	Topic:                  awk - escape sequences in ERE constants
	Relevant Sections: (6)

Defect Report:
	From: mark@mks.com (Mark Funkenhauser)
	Date: Wed, 5 Jul 1995 09:52:40 -0400 (EDT)


Dear Standards Board,

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

    I'd like an interpretation of how awk should be evaluating the
    following ERE constant:

        /x[ab\135cd]y/           # note that \135 is the octal escape 
                                 # sequence for the ']' character.

    Should this be interpreted as

        /x[ab]cd]y/              # this matches the string  "xacd]y"

    or should this be interpreted as (is done historically)

        /x[<one of a,b,c,d,\135>]y/    # this matches "x]y"

    My reading of subsection (6) lines 1113-1116 indicates that
    the former interpretation is correct but this does not conform
    to historical practice.

    Thank you for your attention to this matter.

    Mark Funkenhauser

Interpretation response

The standard clearly states the behavior for ERE's in awk, 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 6 1995
Proposed resolution forwarded: Aug 11 1995
Finalized: Sept 12 1995