zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Sebastian Gniazdowski <sgniazdowski@gmail.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: Discovered pattern that ideally parses any quoting. Brackets highlighting in FSH.
Date: Wed, 1 Aug 2018 11:18:07 -0700	[thread overview]
Message-ID: <CAH+w=7bP_5ahuJZgswkmeyiF1Ozua0uznvZq0anzAVpA5c1kbw@mail.gmail.com> (raw)
In-Reply-To: <CAKc7PVAbwaZr6Pr8weACs7W7E1A6GF5y7QpwRanssYFdGnzSww@mail.gmail.com>

On Mon, Jul 30, 2018 at 12:09 AM, Sebastian Gniazdowski
<sgniazdowski@gmail.com> wrote:
>
> not only (z) can handle quoting, turns out regular pattern with while
> loop can do it too:

Yes, this is actually quite commonly done when writing ad-hoc parsers
in perl via variations on

while (s/^(the-leading-part)//g) {
  do something with $1;
}

Usually you need at least a counter to for example keep track of the
depth of parenthesis nesting, but maybe that part is being handled
outside the code snippet you demonstrate in this thread.


  parent reply	other threads:[~2018-08-01 18:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-30  7:09 Sebastian Gniazdowski
2018-07-31  4:16 ` Sebastian Gniazdowski
2018-07-31  5:13   ` Sebastian Gniazdowski
2018-08-01 18:18 ` Bart Schaefer [this message]
2018-08-02  7:32   ` Sebastian Gniazdowski

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='CAH+w=7bP_5ahuJZgswkmeyiF1Ozua0uznvZq0anzAVpA5c1kbw@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=sgniazdowski@gmail.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).