mIRC Homepage
Posted By: Wims $regsubex with $N - 24/01/08 07:26 PM
Code:
//tokenize 32 1 2 | echo -a > $regsubex(a,/a/,$1 $2)
//tokenize 32 1 2 | echo -a > $regsubex(a,/a/,Ga $1)
I think this is a bug, in the third parameter of $regsubex, $N return $null...

Edit : another strange thing :
Code:
echo -a > $regsubex(waf,/(a)/,$(\1,0))


Using $regsub works nice
Posted By: qwerty Re: $regsubex with $N - 24/01/08 09:17 PM
That's an unfortunate side-effect of the fact that mirc uses $1, $2 etc internally to fill the values of \1, \2, \t, \a etc in <sub>. To get an idea, try this:
//echo -ag $regsubex(a,/(a)/,< $1 : $2 :: \1 \n >)

The $+ stuff you saw in your second example are due to the fact that when mirc encounters something like "a\1b", it turns it to "a $+ $1 $+ b", so that $1 doesn't touch other things. In this case, b is the comma right after \1 (if you leave a space, you'll see $+ is omitted).

This doesn't happen in $regsub because of the completely different way <sub> is evaluted there.

Posted By: Wims Re: $regsubex with $N - 24/01/08 09:44 PM
Thank you for this explanation smile
© mIRC Discussion Forums