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

Re: Why no $match for parens inside a ~^ ?



On Wed, Jan 25, 2023 at 6:53 AM Sebastian Gniazdowski
<sgniazdowski@xxxxxxxxx> wrote:
>
> [[ "zparseopts -F" == (#b)*(zparseopts)*~^*(-F)* ]]

I'm not 100% sure, but I think the problem here is that the negation
with ^ is processed in a secondary invocation of the pattern matcher
so the $match from parens there is overwritten by the results of the
previous pattern.

This behaves differently (but perhaps not quite what you're after):

[[ "zparseopts -F" == (#b)*(zparseopts)(*~^*(-F)*) ]]




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