Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zregexparse
- X-seq: zsh-users 22643
- From: Sebastian Gniazdowski <psprint@xxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, zsh-users@xxxxxxx
- Subject: Re: zregexparse
- Date: Fri, 31 Mar 2017 08:58:52 +0200
- In-reply-to: <etPan.58ddeed9.12200854.17199@MacMini.local>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <etPan.58db747f.515f007c.17199@MacMini.local> <170330221929.ZM18456@torch.brasslantern.com> <etPan.58ddeed9.12200854.17199@MacMini.local>
PS. I've examined if zregexparse could be use to fill region_highlight, and it seems it can't:
zregexparse p1 p2 abc \( '/bc|?/' '{print "$p1, $p2, $mbegin[1], $mend[1], $match[1]"}' \) \#
1, 1, 1, 1, a
3, 3, 1, 2, bc
The "|?" is needed, otherwise "bc" will not be matched – no substring matching. $p1, $p2 are quite veird values, rather not usable as mbegin/mend (except if they are mend, then mbegin could be computed using $#match[1]). And the mbegin, mend are set locally, i.e. always start from "1".
--
Sebastian Gniazdowski
psprint /at/ zdharma.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author