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!
In reply to Re^2: capture global substituion inot an array
by wrinkles
in thread capture global substitution in an array
by wrinkles
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |