Charles Levert <[EMAIL PROTECTED]> writes:

> * On Sunday 2005-11-06 at 23:51:12 +0100, Andreas Schwab wrote:
>> Charles Levert <[EMAIL PROTECTED]> writes:
>> 
>> > * On Sunday 2005-11-06 at 22:48:30 +0100, Andreas Schwab wrote:
>> >> only in BREs which don't have alternation.
>> >
>> > Is that the justification?
>> 
>> I don't understand your question, but my point is that if you don't have
>> alternation (and neither optional matches) the group referenced by a
>> back-reference has always matched something fixed.
>
> Well, no, as my example showed.  It contained
> a bracket expression, [xy], and these are
> not fixed, are allowed in BREs, and are the
> equivalent of an alternation like (x|y).

No, they are not equivalent.  You can back-references only a complete
bracket expression (and when you reference it it has matched a fixed
string), whereas an alternation has sub expressions of its own.  Thus with
brackets the issue of back-referencing a sub expression that didn't match
cannot occur.

Andreas.

-- 
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Reply via email to