I'm writing a JavaScript code like this:
var regex = new RegExp(["^",skill,"$"].join(""),"i");
When skill = 'c++', it reports an error "SyntaxError: Invalid regular expression: /^c++$/".
Any advice on how to write the regex in the correct way to take care of characters like "+"?