Hi !
I don't know if it's the best way to do what you want, but maybe you can try this :
code:
var MyPSM = "[c=1]Color1[/c][c=2]Color2[/c]";
for(var a=0;a<=54;a++){
RgEx = new RegExp("[[]+c="+a+"+[]]","gi");
MyPSM = MyPSM.replace(RgEx,"·$"+a);
}
RgEx = new RegExp("[[]+/c+[]]","gi");
MyPSM = MyPSM.replace(RgEx,"·$");
MsgPlus.DisplayToast("",MyPSM);
I've got a lot of Web sites which explain how RegExp works... but they're only in French...