docs: function regEscape(str) {
    // essentially stolen from https://github.com/component/escape-regexp with a modified replacer
    return String(str).replace(/([.*+?=^!:${}()|[\]\/\\])/g, function (match, paren, index, orig) {
      if (match === ':' && orig[index + 1] !== '/')
        return match;
      
      // if star, it's a wildcard if only enclosed by forward slashes (or at start or end of string)
      if (match === '*' && (index === 0 || orig[index - 1] === '/') && (index + 1 === orig.length || orig[index + 1] === '/'))
        return '.*';
      
      return '\\' + match;
    });
  }