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

[Bug] S-flag imposes non-greedy match where it shouldn't



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