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

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



Le 25/07/2023 à 20:35, Bart Schaefer a écrit :
On Tue, Jul 25, 2023 at 6:19 AM Johan Grande <nahoj@xxxxxxxxx> wrote:

In zsh 5.8.1 (x86_64-ubuntu-linux-gnu) with extended_glob,

[[ "ab" = (|a*)~^(*b) ]]

incorrectly (unless I'm mistaken) returns 1.

This is not precisely a bug, it's expected behavior.  Alternation with
(x|y) tries the patterns in left-to-right order and has lower
precedence than p~q (despite the parens).

I don't get it. What are the different patterns tried during this left-to-right evaluation of (|a*)~^(*b) ?

--
Johan





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