Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: alternation option end of string
- X-seq: zsh-users 30620
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Ray Andrews <rayandrews@xxxxxxxxxxx>
- Cc: zsh-users@xxxxxxx
- Subject: Re: alternation option end of string
- Date: Sat, 2 May 2026 15:25:01 -0700
- Arc-authentication-results: i=1; mx.google.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=tLtZegbjAC8R9BexqpP2xcTyG8wKG6nW2PK6jepxh9Q=; fh=D6X9xIaVjTSxb6gwuCseglo0uxyISp24IsyxMp5sRU4=; b=QYuFRM6budWdwhwjeGXOITtbq2/VrDpfYxUtPxAp1JmCwebsZKO8UPRAu7f916BJrt B784E82rLbsLpMxnMYFd+23zbuItWf/jDKHV0ZxCTzPwyOT0Y2mqO+3VxVgkB7OQCWSp d6GVa9PoB8uk0oTYp8hWeyG0LQt29Og9CxCgEpMLgsIlGmMZo6qCvOKkz3n0uQAF+EYV MOE+UooJmQPMpojkgyuTJ1eeJ2USvzAtZs/oNUWHDKCVsxLdKUSQb6jtWyZnCaP7IIcg K5G4WuzWIqHg8Ftq7e8DuRSgpyv0UP/Udw8va4UiwLWIcSI21VaOCBfDTyV8JHUiTcyt pSbw==; darn=zsh.org
- Arc-seal: i=1; a=rsa-sha256; t=1777760713; cv=none; d=google.com; s=arc-20240605; b=ly+jCWMUWPcsXX4A5aztsKkfxkpWCh17yoGT3Ih/d2Rl2sXLHpEvl0hB1s4y3gnmFR cVaj5wx0F5DaBp2NtK77jIz50zfgpoNcmGKCQO9vYfHyYpO10A22G1Ec1UDbjYfgvPmc Xp4RIhXD1kEOh+pigF+YKD7LBwt1289oW8Yp2DSnNYbR8nZ8FtzcvJ4DzJWxmmBbY4eE 0PT/poKIUtnJsaxSn6+yQtxBrTYnzNnWWGKdD66flcplf7hflbBo1VK64WkFl6cnQE7j ARGKtqSHP1RhvMwX8nm879Paezn0nmG6E8LpGv/lQlenx0arADlrmY61atRnka0IMusv kZkg==
- Archived-at: <https://zsh.org/users/30620>
- In-reply-to: <bdac06e0-d9e3-47df-9457-511e45fc507b@eastlink.ca>
- List-id: <zsh-users.zsh.org>
- References: <b145bb3c-51ee-4088-8b6b-12c6b440d9e6@eastlink.ca> <CAA=-s3wEGdY1Ts1bO+vH-Z8C7RH8d2CWXERF+SxAtXFpGoxgNA@mail.gmail.com> <89738d31-840a-4bb5-ab7e-55d60f9ab52c@eastlink.ca> <61062ae9-d338-4036-8a4d-5c35c8c84b6d@eastlink.ca> <0357522b-3917-4be2-b969-2b1a7481115c@gmx.com> <e18cfb47-8ca6-4e13-b6e1-e333f7547b59@eastlink.ca> <CAN=4vMpz9buom+J_qcyv61X8BVV5CYZvb2qQuhyu6QNdg=VYnw@mail.gmail.com> <bdac06e0-d9e3-47df-9457-511e45fc507b@eastlink.ca>
On Sat, May 2, 2026 at 9:59 AM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
> ${${(M)string:#cat(|s*)}[1,4]}
>
> But the length of the string is arbitrary I can't use any sort of length.
See my previous message with the ${things:-${thing}} example.
> Too bad what Mark said about using the '$' to test for the end of the string seems not to work
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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author