there is a small 'off by 1' bug in mIRC's current implementation of //g that presents itself when \K is used at the end of certain patterns:

Code:
//echo -a $regsubex(abcd, /.\K/g, <>)


= a<>bc<>d

since \K effectively 'dumps' the portion of the subject consumed up until the point it's used, preventing it from being substituted, this should insert '<>' after every character.. but misses both 'b' and 'd'.

my guess is that, when //g is used, mIRC places successive calls to the pcre_exec() function with a startoffset value that is determined solely by looking at the return values associated with the last call to the function (namely, the start and end offsets ovector[0] and ovector[1] respectively).

if ovector[0] == ovector[1], implying that an empty substring was consumed, mIRC advances the start offset to 1 more than it normally would (ovector[1]) so as to avoid potentially endless calling of the function. however, it should only add 1 if ovector[1] == the original startoffset value that was passed to pcre_exec(). so the new offset should be 'ovector[1] + (oldoffset == ovector[1])' rather than 'ovector[1] + (ovector[0] == ovector[1])', so to speak :P


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde