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

The ~ parameter expansion flag: bug or misunderstanding



I understand that you can split a parameter value on a fixed string:

% print -l ${(s.1.):-a1b1c}
a
b
c

My reading of the ~ flag leads me to believe that you can replace the
literal string with a pattern, so that

% print -l ${(~s.[12].):-a1b2c}
a
b
c

However, the ~ flag seems to have no effect, with the parameter string
remaining unsplit.

-- 
Clint


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