Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zregexparse
- X-seq: zsh-users 22644
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: zregexparse
- Date: Fri, 31 Mar 2017 14:13:59 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=Oycw9IcdCNuH/05SXUf3fgTmFzWwrjdebOIFroCH79Q=; b=ieIjRHOk9ul08Pz/+skdesGi0LY0XygQWQDytK8ocrVORDlot552lQqanBgLmWZP6c TtuBmTrfqlIYY5RAeRavZD74AZDP/B75XzWQ1Ntw9aNEazkk0ASYEdkjQc6rLK6ezsdi SFs80si0jRJEP1no+YK5ze462q5qVfH4zH/FNun70ELRX7eeSM56NenlZVve5cnvGBnJ CnOp/P5M4hE0jLAYh6Z96nblOrGzW42zGqxQU0blZ/F/vRgMHDsE1jYtfcr2W2UbTorl m3nDQxBdCbdoPkh9wYMBLJVzKecCEb9GcYIQDRioKAZlUpCZdEUlvp09ABjMzWGrLqoK HWEg==
- In-reply-to: <etPan.58ddfe2c.216231b.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> <etPan.58ddfe2c.216231b.17199@MacMini.local>
On Mar 31, 8:58am, Sebastian Gniazdowski wrote:
} Subject: Re: zregexparse
}
} 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 return values from zregexparse are pretty strongly tailored to be
used with compset and compadd, and it does nothing useful with $match
and friends -- it's not tied into glob pattern referencing at all.
The values stored in $p1 and $p2 here are intended to calculate offsets
into "abc" for a call to compset -p, which isn't going to help you with
ranges for highlighting. Also (though not significant in this eample),
zregexparse expects words joined with $'\0'.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author