Re: alternation option end of string
Ray Andrews <[email protected]>
| Newsgroups | gmane.comp.shells.zsh.devel |
|---|---|
| Message-ID | <61062ae9-d338-4036-8a4d-5c35c8c84b6d__14865.9070416883$1777682258$gmane$org@eastlink.ca> |
On 2026-05-01 16:56, Ray Andrews wrote:
>
>
> On 2026-05-01 15:39, Mark J. Reed wrote:
>> $
>>
>> e.g. 'a(b|$)' will match an a that is either followed by a b or at
>> the end of the strings
>>
>>
I must be doing something wrong:
% string='cats'
% out="${(M)string##cat(s|$)}"; echo $out
cats
% string='cat'
% out=${(M)string##cat(s|$)}; echo $out
[nothing]