I have to disagree that 4321 is the expected output for \0, Nowhere does it state its the total matches at that position in the help file. Concidering mIRC's own behaviour with 0 in identifiers 4444 is the expected output. \0 returning 4321 is pretty a confusing result for \0, but i do think another special substitute character might be in place for it becouse knowing the remaining number of matches can be a powerful trick in substituting. \0 is a value that shouldnt change as it should stand for total matches the regex made regex.
Especially concidering the alternative youd have to use to get that number now is to precache the regex and use $regml(0) as replacement text which totally defeats the main purpose of regsubex in my eyes.
Adding on to this (and not waste another topic :tongue:) there should be a nonspaced version of \a (\A?). so $regsubex(Test,/(.)/g,\A) returns TestTestTestTest
never really said it was "right" just it seemed to make more sence, than having an identifier that held the total matches, as i couldnt see a large scale purpose of subsituting the total matches over and over, while i could see a use of a descending count (ascending wiould be more usefull but still atleat the match points would be refrenceable using a descending one)
Of course if as u said a seperate directive for each, well that would be even better.
PS: my understanding of regex is very limited , so im looking at this from a very simple point of view, please excuse any facts i am unaware of (ie; if that can already be done)