in reply to Substitution with matching nested boundary conditions

What's supposed to happen when "zimzam" occurs more than once within a given "foo ... bar" span? Note that the excellent solution provided by dave_the_m would only replace the first occurrence in that case, but just add a "g" modifier on the "inner" s/// operation to make it apply to all occurrences of "zimzam" within the captured "foo...bar" range.
  • Comment on Re: Substitution with matching nested boundary conditions

Replies are listed 'Best First'.
Re^2: Substitution with matching nested boundary conditions
by redhotpenguin (Deacon) on Jan 25, 2008 at 06:42 UTC
    It should be replaced in all occurrences. I actually ran into that, and added the g modifier, and it worked great.