I'm trying to use variable inside regex match function but it's not working.
Here is my code:
var text = "jon";
Persons.match('/<tr><td>(.*?)'+ text +'(.*?)<\/tr>/g');
I have also try it:
Persons.match(/<tr><td>(.*?)text(.*?)<\/tr>/g);
it's consider text as a string not a variable.