How do you check, in JavaScript, if a string is a proper regular expression that will compile?
For example, when you execute the following javascript, it produces a
function isRegExp(regExp){ try { new RegExp(regExp); } catch(e) { return false } return true } ex: isRegExp(/@(\w+)/g) = true