Hey guys, I'm having a little trouble getting a regsubex replace working. I have a color script that colors my text. I want to modify it so that I can be typing in say green, and change a portion to red. Here's an example: greentext@red(redtext)greentext. The actual text would show up as greentextredtextgreentext but the colors would be green-red-green.

Currently the regsubex I'm using is
Code:
 $+ %text.color $+ $regsubex($1-,@([^$chr(40)]*)($chr(40)(.*?)$chr(41))/g, $+ 04$chr(44)01 $+ \3 $+  $+ 09$chr(44)01)

Where %text.color = 09,01. Now, I have the $chr's in there as escapes, since mirc didn't want to take
Code:
@([^\(]*)(\((.*?)\))
because of the parentheses.

I'm just wondering if anyone can point out a reason why this might not work. It stopped giving me "Invalid format: $regsubex" after I replaced the invalid characters with $chr's, but even though the code is valid in all of the regex testers that I've tried it still doesn't work. I know this is kinda convoluted, so feel free to ask any clarifying questions if you have them.