The implied specification of Re^4: RegExp: pos management in global substitution can be met by changing the regex sub-expression (actually, it happens to be the whole regex)
    (?: \G (?<! ^) | ^ \{ name_a) $param_xy*+ \K $param_any
to
    (?: \G (?<! \A) | \{ name_a) $param_xy*+ \K $param_any
in the function  xform() of Re: RegExp: pos management in global substitution (see Update 2).

OK, so what's the next specification increment? Totally arbitrary embedded whitespace, including newlines? Bring it on!

BTW: The discussion of the "\G assertion" in the Regexp Quote Like Operators section of perlop includes the disquieting warning 'Note also that, currently, "\G" is only properly supported when anchored at the very beginning of the pattern.' (emphasis added). I don't understand all the implications of this restriction, but I strive diligently, perhaps slavishly and superstitiously, to heed it, even making sure that in a regex expression like
    \G (?<! \A)
(end of last match except when at absolute start of string) the  \G assertion appears at the very start of the regex. I mention this because I noticed the expression
    (?:\{name_a | \G)
in your code and I don't know its possible effect(s). You have been warned!


In reply to Re^5: RegExp: pos management in global substitution by AnomalousMonk
in thread RegExp: pos management in global substitution by OlegG

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.