I'm trying to create a regex pattern out of a variable like:
var tag = "style";
var pattern = "/<"+tag+"[^>]*>((\\n|.)*)<\\/"+tag+">/gi";
but it won't work - anyone can tell me what's wrong?
I'm trying to create a regex pattern out of a variable like:
var tag = "style";
var pattern = "/<"+tag+"[^>]*>((\\n|.)*)<\\/"+tag+">/gi";
but it won't work - anyone can tell me what's wrong?