code: function getRegExp(node) {
  
          if (node.value instanceof RegExp) {
              return node.value;
          } else if (typeof node.value === "string") {
  
              var parent = context.getAncestors().pop();
              if ((parent.type === "NewExpression" || parent.type === "CallExpression") &&
              parent.callee.type === "Identifier" && parent.callee.name === "RegExp") {
  
                  // there could be an invalid regular expression string
                  try {
                      return new RegExp(node.value);
                  } catch (ex) {
                      return null;
                  }
  
              }
          } else {
              return null;
          }
  
      }
docs: Get the regex expression
  @param {ASTNode} node node to evaluate
  @returns {*} Regex if found else null
  @private