I'm new to the forum. Many Thanks to "stackoverflow" and you for the opportunity.
I have a problem. How I can pass a variable to a regular expression to split?
I have this:
var text = "I am new to the forum";
var term = "TO";
var textSplit = text.split(/term/gi);
What I like to do is to pass the variable "term" to the regular expression so you can divide if no match, but not how. Any idea better.
Thank you!