I guess I'm not very good at regular expressions, so here is my problem (I'm sure it's easy to solve, but somehow I can't seem to find how )
var word = "aaa";
text = text.replace( new RegExp(word, "g"),
"<span style='background-color: yellow'>"+word+"</span>");
this is working in most cases.
What I want to do is for the regex ONLY TO WORK when word is not followed by the char / and not preceded with char ".