http://www.perlmonks.org?node_id=806301


in reply to Re^4: Recursive substitution
in thread Recursive substitution

I want recursion.

Sorry, but you can't execute another s/// without /e, (?{}) or (??{}). Recursion is out.

As for a solution without recursion, I don't know of any.

Replies are listed 'Best First'.
Re^6: Recursive substitution
by JadeNB (Chaplain) on Nov 10, 2009 at 19:33 UTC
    Sorry, but you can't execute another s/// without /e, (?{}) or (??{}).
    Since the regex engine isn't re-entrant, I can't execute another s/// even with /e, (?{}), or (??{}), right?
      That is my understanding. You can have recursive patterns, but I don't think you can enter another match when one is already in progress.