My problem is getting the string from the user and turning it into a regular expression. If I say that they don't need to have
//'s around the regex they enter, then they can't set flags, like
i. So they have to have the
//'s around the expression, but how can I convert that string to a regex? It can't be a literal since its a string, and I can't pass it to the RegExp constructor since its not a string without the
//'s. Is there any other way to make a user input string into a regex? Will I have to parse the string and flags of the regex with the
//'s then construct it another way? Should I have them enter a string, and then enter the flags separately?