I'm trying too use JavaScripts "replace"-function to put tags around text given in between certain characters. Example:
str.replace(/\_(.*?)\_/gi, '<u>$1</u>');
Now this works fine but I want the "_"-characters to be given as a variable. For example:
var und = "_";
str.replace(/\und(.*?)\und/gi, '<u>$1</u>');
My question is how can I do that?
Thnx in advance!