lol yeah i should have known why i was the person who found out mIRC translates to $n internally in the regsubex to do the actual substitution.
See in action:
//echo -a $regsubex($str(.,23),/(.)/g,$(\1,0))
Posted the wrong one :) $1- should also be $1
the fix is easy though:
alias charcheck return $regsubex($1,/(?<=\s|^)([^ $chr($2) ])/gx,$chr( [ $2 ] )\1)