zsh-users
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <psprint@zdharma.org>
To: Bart Schaefer <schaefer@brasslantern.com>, zsh-users@zsh.org
Subject: Re: zregexparse
Date: Fri, 31 Mar 2017 08:58:52 +0200	[thread overview]
Message-ID: <etPan.58ddfe2c.216231b.17199@MacMini.local> (raw)
In-Reply-To: <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


  reply	other threads:[~2017-03-31  6:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-29  8:46 zregexparse Sebastian Gniazdowski
2017-03-31  5:19 ` zregexparse Bart Schaefer
2017-03-31  5:53   ` zregexparse Sebastian Gniazdowski
2017-03-31  6:58     ` Sebastian Gniazdowski [this message]
2017-03-31 21:13       ` zregexparse Bart Schaefer
2017-04-01 10:21         ` zregexparse Sebastian Gniazdowski
2017-04-01 16:43           ` zregexparse Bart Schaefer
2017-04-01 23:21             ` zregexparse Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=etPan.58ddfe2c.216231b.17199@MacMini.local \
    --to=psprint@zdharma.org \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).