Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Discovered pattern that ideally parses any quoting. Brackets highlighting in FSH.
- X-seq: zsh-users 23550
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- Subject: Re: Discovered pattern that ideally parses any quoting. Brackets highlighting in FSH.
- Date: Wed, 1 Aug 2018 11:18:07 -0700
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ZQEFJO9jY2lhmaCEtldmqAQuV4yyweRdUS37Wq1N/24=; b=lHXT+9mhTFLM/xZxUOK09vDP7UZ3tBdxLgktMqu4HO9ZxpWn60lJweBVQwDCXsKok2 ygVTrHeg4RKlvKRmwMVWbdhw3mro1ReqAEWK6afucgHYRy/PMnHxX/vJR34RD97ohJVR 9r63R/POWzKFweFJS9WWVjkhx4fI+c9Or3SwvBfWqPPBDldI+MZH53EmwphSxtEK4IPT NcdPfSuWQnS76grYRR/MbtspgFvT2m0VB/z4Qu+zFzGbsUSeOJ7JqImOJE49057NhRlp K762n+5fH8o2sYFzIqCj/asJwUQZ0pdSyf0gOUOXmUxJqj+dmLiE7ETFHYwHRJT9/ZU/ 6bTw==
- In-reply-to: <CAKc7PVAbwaZr6Pr8weACs7W7E1A6GF5y7QpwRanssYFdGnzSww@mail.gmail.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: <CAKc7PVAbwaZr6Pr8weACs7W7E1A6GF5y7QpwRanssYFdGnzSww@mail.gmail.com>
On Mon, Jul 30, 2018 at 12:09 AM, Sebastian Gniazdowski
<sgniazdowski@xxxxxxxxx> 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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author