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

RE: RE_CONCAT: question about RE concatenation and subpattern matching

To: "'Paul Eggert'" <yyyyyy@xxxxxxxxxxx>, yyyyyyyyyyyyyy@xxxxxxxxxxxxx
Subject: RE: RE_CONCAT: question about RE concatenation and subpattern matching
From: Schwarz Konrad <yyyyyyyyyyyyyy@xxxxxxxxxxxxxxx>
Date: Mon, 29 Apr 2002 09:26:58 +0200
Cc: yyyy@xxxxxxx, yyyyyyyyyyyyyy@xxxxxxxxxxxxx, yyyyy@xxxxxxxxxx, yyyyy@xxxxxxxxxxxxxx, yyyy@xxxxxxxxxxx
> -----Original Message-----
> From: Paul Eggert [mailto:yyyyyy@xxxxxxxxxxx]
> Sent: Friday, April 26, 2002 8:00 PM
> To: yyyyyyyyyyyyyy@xxxxxxxxxxxxx
> Cc: yyyy@xxxxxxx; yyyyyyyyyyyyyy@xxxxxxxxxxxxx; yyyyy@xxxxxxxxxx;
> yyyyy@xxxxxxxxxxxxxx; yyyy@xxxxxxxxxxx
> Subject: Re: RE_CONCAT: question about RE concatenation and subpattern
> matching

> If the algorithm was really supposed to maximize the length of
> subexpressions only (and not all subpatterns), then when you match
> /(ba*)*.*/ against "bab", \1 would have to match "ba", since "ba" is
> "the longest match for the leftmost subexpression".  But nobody is
> arguing that \1 should match "ba"; everyone agrees that \1 should
> match the trailing "b" in this example.  So it doesn't make any sense
> to maximize the length of subexpressions only.

This confused me.  Is the reason because
/(ba*)*.*/ is the same as /ba*(ba*)*.*/ ?

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