Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: (j.|.)
On Tue, Jan 31, 2023, at 7:21 PM, Ray Andrews wrote:
> On 2023-01-31 15:33, Lawrence Velázquez wrote:
>> Search for "x|y" in zshexpn(1).
> No completions.
I don't know you're talking about. Just run "man zshexpn" and
search for "x|y". (You might have to escape the "|". Alternately,
search for "Glob Operators" and find it by eye.)
>> Search for "Subscript Flags" in zshparam(1), then find the "I" flag.
> Ok, I have that one about understood. So many tricks attach to
> associative arrays!
The flag is not limited to associative arrays.
% foo=axaybxby
% print ${foo[(I)a?]}
3
% bar=(ax ay bx by)
% print ${bar[(I)a?]}
2
% typeset -A baz=(ax 1 ay 2 bx 3 by 4)
% print ${baz[(I)a?]}
ax ay
--
vq
Messages sorted by:
Reverse Date,
Date,
Thread,
Author