I need a hand to sub a variable into a regular expression
this line works fine:
subject = subject.replace(/<a title="Smile"><img.+?<\/a>/g, emoticons[1]);
I need switch the word "Smile" for a variable.
I have tried a few different configurations like:
subject = subject.replace(/<a title="'+emoLanguage[0]+'"><img.+?<\/a>/g, emoticons[1]);
but I can't get the variable to work.
Whats the trick??