Thanks, been talking with SilentDragon on WLM and we seem to have sorted it out
I'll post the code for others that are looking for the same thing so it does not get asked again
code:
for(a=0;a<=54;a++){
strMyNewPSM = strMyNewPSM.replace(new RegExp("\\[c="+a+"\\]",'gi'),"·$"+a+" ");
strMyNewPSM = strMyNewPSM.replace(/\[\/c\]/g,'·$1');
}
strMyNewPSM = strMyNewPSM.replace(/ [\s]/g,"");
EDIT: My code was using a loop to change EACH colour individually so putting it in another loop was the only alternative... After trying this I had to close WLM and edit the file in Notepad as it caused a wierd loop error