code: function check(node) {
  		if (node.callee.type === "Identifier" && node.callee.name === "RegExp" && isString(node.arguments[0])) {
  			var flags = isString(node.arguments[1]) ? node.arguments[1].value : "";
  
  			if (allowedFlags) {
  				flags = flags.replace(new RegExp("[" + allowedFlags + "]", "gi"), "");
  			}
  
  			try {
  				void new RegExp(node.arguments[0].value);
  			} catch (e) {
  				context.report(node, e.message);
  			}
  			if (flags) {
  				try {
  					var result = parser.parse("/./" + flags, context.parserOptions);
  					if (result.body.length > 0) {
  						var expressionStatement = result.body[0];
  						var regexp = expressionStatement.expression;
  						if (regexp && regexp.value === null) {
  							context.report(node, ProblemMessages.noInvalidRegexp, {
  								arg: flags
  							});
  						}
  					}
  				} catch (ex) {
  					context.report(node, ProblemMessages.noInvalidRegexp, {
  						arg: flags
  					});
  				}
  			}
  		}
  	}
docs: Validate strings passed to the RegExp constructor
  @param {ASTNode} node node to evaluate
  @returns {void}
  @private