Email List: Xaustin-group-lX
[All Lists]

Re: RE_CONCAT: question about RE concatenation and subpattern matching

To: yyyyyyyyyyyyyy@xxxxxxxxxxxxx
Subject: Re: RE_CONCAT: question about RE concatenation and subpattern matching
From: Paul Eggert <yyyyyy@xxxxxxxxxxx>
Date: Tue, 9 Apr 2002 15:20:11 -0700 (PDT)
Cc: yyyyy@xxxxxxxxxxxxxx, yyyyy@xxxxxxxxxx, yyyy@xxxxxxx
References: <200204091857.OAA35259@raptor.research.att.com>
Quoting from the minutes of the June 1995 POSIX RE experts meeting
recently forwarded by David Korn:

>             To resolve Interp #43, Part 14, add on page 77, Section
>             2.8.2 of P1003.2 after sentence ending on line 2792,
>             "An enclosed subpattern is deemed to be to the right of
>             an enclosing pattern.

This resolution means the matching priority is determined by a
preorder traversal of subpatterns in the RE's parse tree.  For
example, when matching /((week|wee)(night|knights))(s*)/ against
"weeknights", /(week|wee)/ is deemed to be the right of its enclosing
pattern /((week|wee)(night|knights))/, and therefore
/((week|wee)(night|knights))/ must match "weeknights" and /(week|wee)/
must match "wee".

This interpretation is consistent with RE-CONCAT interpretation (1).
It contradicts RE-CONCAT interpretation (2), because RE-CONCAT(2)
requires that /(week|wee)/ must match "week" in the same example.

I see that Andrew Hume writes that RE-CONCAT(2) is "simply wrong" and
that RE-CONCAT(1) is correct.  This also agrees with the June 1995
minutes.

Since RE-CONCAT(2) is rejected, I'll assume RE-CONCAT(1) in my next
message, which will be about RE-ASSOC.

<Prev in Thread] Current Thread [Next in Thread>