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

Re: ${(S)%%*} doesn't match the empty string (was: Re: [PATCH] zshexpn: Expand documentation of (S) (was: Re: [Bug] S-flag imposes non-greedy match where it shouldn't))



On Mon, 30 Dec 2019 at 22:46, Roman Perepelitsa
<roman.perepelitsa@xxxxxxxxx> wrote:
>
> On Mon, Dec 30, 2019 at 10:25 PM Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> > > Also, ${str%*} doesn't expand to $str,
> >
> > It does for me; see above.
>
> I believe Sebastian is correct in that ${str%*} used to chop off the
> last character from str. It's been fixed at some point. Perhaps
> ${(S)str%%*} was supposed to get fixed at the same time but somehow
> eluded it?

Yes, running the latest zsh reveals it has been fixed (I was running a
few commits behind HEAD).


-- 
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org



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