Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Pattern bug on (a*|)~^(*b)



On Tue, Jul 25, 2023 at 11:47 AM Johan Grande <nahoj@xxxxxxxxx> wrote:
>
> I don't get it. What are the different patterns tried during this
> left-to-right evaluation of (|a*)~^(*b) ?

I'm going to invoke my "PWS may be able to explain some more" remark,
but basically once you cross the "~" it's no longer possible to
backtrack again; so it tries to match the empty alternative, gets an
empty result set, excludes ^(*b) from that result set leaving a
still-empty set, can't go back, and fails because the final result is
empty.  I don't recall all the details but this has something to do
with X~Y implemented as "exclude Y from the result of X".




Messages sorted by: Reverse Date, Date, Thread, Author