I want to convert a string that looks like a regular expression ... to a regular expression.
The reason I want to do this is because I am dynamically building a list of keywords to be used in the regular expression. For example, with file extensions, I would provide a list of valid extensions that I want to include in the regular expression.
var extList = ['jpg','gif','jpg']; var exp = /^.*\.(extList)$/;
Thanks, any help is appreciated
source share