Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Why no $match for parens inside a ~^ ?
- X-seq: zsh-users 28798
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Why no $match for parens inside a ~^ ?
- Date: Wed, 25 Jan 2023 14:05:05 -0800
- Archived-at: <https://zsh.org/users/28798>
- In-reply-to: <CAKc7PVAi_sV+=NELcYuwH4Tf4i=XH+p6_=eaen-Yq0d+t5LQYw@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CAKc7PVApZGZV2brB+d3nd+ThLXzYvy9QjC16vYg-j76MrYD-Fg@mail.gmail.com> <CAKc7PVAi_sV+=NELcYuwH4Tf4i=XH+p6_=eaen-Yq0d+t5LQYw@mail.gmail.com>
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