Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Return a formatted string
<?php sprintf(string $format, mixed ...$values): string
<?php     public static function toRegEx($glob, $flags = 0, $delimiter = '~')

    {

        if (!Path::isAbsolute($glob) && false === strpos($glob, '://')) {

            throw new InvalidArgumentException(sprintf(

                'The glob "%s" is not absolute and not a URI.',

                $glob

            ));

        }



        $inSquare = false;
<?php         }



        if ($inSquare) {

            throw new InvalidArgumentException(sprintf(

                'Invalid glob: missing ] in %s',

                $glob

            ));

        }



        if ($curlyLevels > 0) {
<?php         }



        if ($curlyLevels > 0) {

            throw new InvalidArgumentException(sprintf(

                'Invalid glob: missing } in %s',

                $glob

            ));

        }



        return $delimiter.'^'.$regex.'$'.$delimiter;
<?php     public static function getStaticPrefix($glob, $flags = 0)

    {

        if (!Path::isAbsolute($glob) && false === strpos($glob, '://')) {

            throw new InvalidArgumentException(sprintf(

                'The glob "%s" is not absolute and not a URI.',

                $glob

            ));

        }



        $prefix = '';