Most people have semi good grammar, so this should be a nice little fix. When you type, you usually use spaces. Ex:
Bob says:
Hey John, I g2g, hospital time...
![:(](images/smilies/msn_sad.gif)
---> Hey John, I got to go, hospital time...
John says:
Okay, br buddy
![:)](images/smilies/msn_happy.gif)
---> Okay, best reguards buddy
So, a simple fix would be instead of:
sMessage = sMessage.replace(/br/gi,"best reguards");
make it
sMessage = sMessage.replace(/ br /gi," best reguards ");
![:)](images/smilies/msn_happy.gif)
. Notice the space. This wont catch "br" at the end of a sentance however. But if you put an extra space at the end, it'll catch it
![;)](images/smilies/msn_wink.gif)
.
This is how I wrote my personal script anyway.