in reply to Re^4: Progressive matching w/substitutions
in thread Progressive matching w/substitutions

You are correct that there were problems in the OP's code. Since the OP also showed desired output, I was expecting that posted solutions would actually produce that output.
FWIW, my post originally said that I had multiple incantations of the code, none of which worked, and that the one posted was an arbitrary one from that set. I didn't necessarily want to focus on the code, per se, but the more fundamental underlying question: why doesn't progressive matching work with s/// expressions as it does with m//? My code was drawing attention to the byproduct of this lack of support for s/// was the need for too much complexity in the while() loop, which also produced code that (in my case, in my examples) didn't work.

I think I overcomplicated things by introducing too much stuff into the post.

  • Comment on Re^5: Progressive matching w/substitutions