in reply to Re: capture global substituion inot an array
in thread capture global substitution in an array

Yes, I suspected that the real problem lies in my misunderstanding. I imagined that there is a mythical "replace" string that substitutes for the matched string. The "replace" of a regex replace is the entire resulting string, and not some discrete "diff" element. Thanks for helping me understand that better.

Perhaps what I am really looking to do (although it may be ill-conceived) is:

This algorithm is certainly not a standard "regex substitution". I'll have to think more about this to determine if it even makes sense to do. But at least you have helped me define the problem. Thanks!

  • Comment on Re^2: capture global substituion inot an array

Replies are listed 'Best First'.
Re^3: capture global substituion inot an array
by ww (Archbishop) on Apr 29, 2012 at 17:45 UTC
Re^3: capture global substituion inot an array
by wrinkles (Pilgrim) on Apr 29, 2012 at 17:50 UTC
    So now I'm thinking that the tag modifier needs three arguments:
    • The match regex expression to extract the substrings.
    • The substitution regex to perform on these captured substrings.
    • The replace expression.
    Is that as crazy as it sounds to me? :)