code:myString = Messenger.MyName; for(a=0;a<=99;a++){ myString = myString.replace(new RegExp("\\[c="+a+"\\]",'gi'),"·$"+a+" "); myString = myString.replace(/\[\/c\]/g,'·$'); } Messenger.MyName = myString;