Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Discovered pattern that ideally parses any quoting. Brackets highlighting in FSH.



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