The help file says:
> Subtext can also contain special markers where \0 = number of matches, \n = match number, \t = match text, \a = all match items, and \A which is a non-spaced version of \a.
//echo -a $regsubex(123:abc 456:def 789:ghi,/(\d+):(\w+)\s?/g,( $+ \t $+ ))
Returns: (123)(abc)(456)
Expected: (123:abc )(456:def )(789:ghi)
Otherwise: (123abc)(456def)(789ghi) ?
\t is only behaving as \1, and has a tracking problem with /g when multiple backrefs exist.
I would expect \t to reference the "matchtext that is about to be replaced." so the user can do something about it. It doesn't say anything about backref match text. Just [/pattern/] match text.
Consider the behavior of this pattern (that has no backrefs): $regsubex(abcdefg,/./g,$asc(\t))
Last edited by Raccoon; 25/02/17 05:02 PM.