Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Match to the end of string when using (S) flag
- X-seq: zsh-users 23744
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Match to the end of string when using (S) flag
- Date: Wed, 7 Nov 2018 13:30:42 +0100
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jAcUY67Ht1fh/5kYJWB66wJ2pSo1SfsFXVSzAbPY+5k=; b=uaJHAls2x9cx4NtgjlIkFivpJIiRQPCf2muc2k9kGCtyEcULmJcDD2zDXN51I/J5FV j/YUE+QaiQFGzNoEep6nwmKTqZCy61YHShCUlNwEUFIYuNBO6TkfxnQFZJYARuJAOiK0 r/RUinqmjzU88hOSwL2Ta4ZInj3zR4bWtHIBXmEx30yjNFt7+ZCsXcjP6IM18s7iUgd6 PAHwdoJZPbeWQRYeQYyNEk2YZU+afxwANSEBOo87dlIXcauOZUkK216AMd+Rw39unVxI jmgyMc9Bmw8Mm62Z1uXLChC7fxFJN9XC+xm72f9/LfdSTlC5/9e9+mdfjwD8uctTS5+t BBTQ==
- In-reply-to: <161101142301.ZM25643@torch.brasslantern.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <1478010333.3056500.773811025.1AAA4FEC@webmail.messagingengine.com> <1478017673.3085741.773974873.7C58DD0B@webmail.messagingengine.com> <1478024975.3113621.774078481.323B1F9E@webmail.messagingengine.com> <161101142301.ZM25643@torch.brasslantern.com>
On Tue, 1 Nov 2016 at 22:29, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> You can do this with just a counter, you don't need a math function:
>
> i=$#region_highlight
> : ${text//(#mi)(${~colsearch_pattern})/
> ${region_highlight[++i]=$((offset + MBEGIN))}
> ${region_highlight[++i]=$((offset + MEND))}
> ${region_highlight[++i]=${__hsmw_hl_color}}}
% text='# This is an example code that is diverse and allows to test a'
% local last=""; : ${text//(#b)([a-d])/${last=${match[1]}}}; print -rl $last
<empty result>
With #m:
% local last=""; : ${text//(#m)([a-d])/${last=$MATCH}}; print -rl $last
<empty result>
How come it works for you?
--
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author