I'm trying to replace smiles in a string with Javascript and this is a line from my code:
res = res.replace(/;\)/g, function myFunction(x){
return '<img src="/emoticons/wink.png" >';
});
It's working fine and when I send ;) it gives me the smile
But the Problem is that when I send '); it works also and give me the same smile
I mean when I send for example Simplemessage('sometext'); it change it to example Simplemessage('sometext'{Smile};