function isQuantifierNext(pattern, pos, flags) {
    const inlineCommentPattern = '\\(\\?#[^)]*\\)';
    const lineCommentPattern = '#[^#\\n]*';
    const quantifierPattern = '[?*+]|{\\d+(?:,\\d*)?}';
    const regex = flags.includes('x') ?
        // Ignore any leading whitespace, line comments, and inline comments
        new RegExp(`^(?:\\s|${lineCommentPattern}|${inlineCommentPattern})*(?:${quantifierPattern})`) :
        // Ignore any leading inline comments
        new RegExp(`^(?:${inlineCommentPattern})*(?:${quantifierPattern})`);
    return regex.test(pattern.slice(pos));
}
Checks whether the next nonignorable token after the specified position is a quantifier.

@private
@param {String} pattern Pattern to search within.
@param {Number} pos Index in `pattern` to search at.
@param {String} flags Flags used by the pattern.
@returns {Boolean} Whether the next nonignorable token is a quantifier.