in reply to strange behavior of JSON parsing guru regex

For tracing it helps to indent depth Also you should used ratcheting/possessive quantifiers in VALUE
  • Comment on Re: strange behavior of JSON parsing guru regex

Replies are listed 'Best First'.
Re^2: strange behavior of JSON parsing guru regex
by seki (Monk) on Apr 16, 2020 at 12:26 UTC

    I tried to handle indentation (see the linked gist in my edit), regex is more ugly. :)

    I don't follow you about quantifiers: apart the starting an ending optional white spaces, all alternatives of a 'value' is one and only one occurrence of an object, number, string, array, true, false, null. What do you suggest to quantify?

    The best programs are the ones written when the programmer is supposed to be working on something else. - Melinda Varian

      I don't follow ...

      In that case I suggest sticking with a module

        The intent was to have a bare-bones self-contained http client with integrated json parser in order to be used on hosts not connected to the internet where only a system Perl 5.16.3 is available and where the installation of an additional package is tedious as I have no root access. Also the number of hosts is high, and the setup is not always the same. So my goal is to keep on a single tools similar to swaks for SMTP.

        The result is published on https://github.com/sebkirche/pcurl/

        I must confess that I later added a pure Perl support for xml by simply embedding XML::TreePP in the script, but I was challenged to understand and fix that power-regex parser. Also the development is still in-progress and I am adding the possibility to do recursive site retrievals in a way similar to wget

        The best programs are the ones written when the programmer is supposed to be working on something else. - Melinda Varian