*sigh* It seems that you didn't understand anything of what I tried to explain...

And how exactly would that be my fault when regular expressions CLEARLY state how to escape the special ( and ) characters with a backslash inside regular expressions and they are usable there as a grouping operator already?!? As I said, its a parsing error, but its still a bug in mirc.

You don't understand how mirc works. PCRE clearly states how to escape the special characters but that has nothing to do with the script parsing; it occurs on a totally different level. In a call to $regex(), mirc parses the parameters passed to it, evaluates their content (so any identifiers/vars are evaluated) and AFTER it has done that, it passes the regex string to the appropriate PCRE function. The problem with the ()'s occurs on the parsing level, not the PCRE level. If you still don't get it, I'm sorry, I really don't feel like writing a couple of pages to explain to you how mirc parses a script. The fact that YOU don't understand how mirc works doesn't mean it's a bug though.


If you would try an example without assuming I did something idiotic like place d the literals ( and ) OUTSIDE of a regex like you did...
//var %a = ) | echo -s $regex(%a, /\)/)
This fails, and in fact any combination I gave above fails and ALL are valid regular expression syntaxes...


Don't you see you just made the same mistake? Let me colour some parts to make it clearer:
//var %a = ) | echo -s $regex(%a, /\)/)
The opening bracket of $regex is the red one and the closing bracket is the green one. What mirc considers the regex pattern is the blue part, which of course doesn't match the input. This is my last attempt to explain this, so I hope you got it.


This ALSO means that if you were to use the \DIGIT syntax (supported by the library) to refer to captured subpatterns you would immediately see the problem between the DEFINED positional syntax and the returned value of $regml() as I did...

There is NO such problem. Try these two commands:
Code:
//var %a | !.echo -q $regsub(teststring,/(test)st(d)?(ring)/,\2,%a) | echo -s $!regml(1) = $regml(test,1) , $!regml(2) = $regml(2) , $!regml(3) = $regml(3) , % $+ a = %a
//var %a | !.echo -q $regsub(teststring,/(test)st(d?)(ring)/,\2,%a) | echo -s $!regml(1) = $regml(test,1) , $!regml(2) = $regml(2) , $!regml(3) = $regml(3) , % $+ a = %a
Notice how $regml(2) and %a (which is filled with \2) are always the same.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com