Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Substituting all but a trailing digit/number
- X-seq: zsh-workers 23676
- From: zzapper <david@xxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: Substituting all but a trailing digit/number
- Date: Fri, 13 Jul 2007 13:22:56 +0000 (UTC)
- Cc: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- Organization: SuccessTheory
- References: <Xns996C883213985zzappergmailcom@xxxxxxxxxxx> <200707131248.l6DCmHAI018710@xxxxxxxxxxxxxx>
- Sender: news <news@xxxxxxxxxxxxx>
Peter Stephenson <pws@xxxxxxx> wrote in news:200707131248.l6DCmHAI018710
@news01.csr.com:
> zzapper wrote:
>>
>> I want to generalise top3 into top4,top5..etc
>>
>> But how could I get filter just the trailing number (in VIM I would use
>> memory)
>
> Use
>
> num=${(M)0%%<->}
>
> The (M) tells the shell to substitute the matched part instead of
> removing the matched part.
Thanks Peter,
And If I wanted to anchor the number to the end?
--
zzapper
http://www.rayninfo.co.uk/vimtips.html
Messages sorted by:
Reverse Date,
Date,
Thread,
Author