Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[Bug] S-flag imposes non-greedy match where it shouldn't
- X-seq: zsh-workers 45085
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: [Bug] S-flag imposes non-greedy match where it shouldn't
- Date: Wed, 18 Dec 2019 21:41:23 +0100
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Hi,
str="aXXXXXbXXXXc"; print ${(S)str##X##}
Output: abXXXXc
As it can be seen, the flag worked correctly. However, when %% will be
used instead of ##:
str="aXXXXXbXXXXc"; print ${(S)str%%X##}
Output: aXXXXXbXXXc
Then the (S) flag seems to impose also non-greedy matching, not only
substring searching.
--
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