globPatternToRegexp (pattern) {
        // Escape everything except ? and *.
        pattern = pattern.replace(regexes.escapeMatcher, regexes.escapeMatchReplacement);
        pattern = pattern.replace(regexes.questionmarkMatcher, regexes.questionmarkReplacment);
        pattern = pattern.replace(regexes.starMatcher, regexes.starReplacement);

        // eslint-disable-next-line security/detect-non-literal-regexp
        return new RegExp(PREFIX_DELIMITER + pattern + POSTFIX_DELIMITER);
    }
Converts a given glob pattern into a regular expression.

@private
@param {String} pattern Glob pattern string
@returns {RegExp=}