Consider this code:
var myregexp = "\\*(.+)"; // set from another subsystem, that's why I'm not using a literal regexp
var input = "Paypal *Steam Games";
var output = input.match(new RegExp(myregexp, 'gi'), "$1");
The output is ["*Steam Games"], but I would like it to be just ["Steam Games"].
What is wrong?
PS A great resource I found today: http://regex101.com/#javascript