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

Re: alternation option end of string





On 2026-05-02 15:25, Bart Schaefer wrote:
It wouldn't have worked even if you were using a regular expression,
for the same reason that (s|) didn't do what you want.  In the
comparison to the string "catszzz" the $ means the end of THAT string
(that is, after the third "z").  It does NOT mean the "end of
matching" up to that point.
A subtle point, and easily missed,  tx.  Anyway Roman's code seems leak proof so far and it's understandable.  But I would have expected something like the $ usable as I'd intended.  But if not, the essential point is that there's no limitation of function.






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