protected function toRegex($str)
    {
        $value = Expression::create($str);

        if ($value->isGlob()) {
            $value = $value->getRegex();

            if (false === strpos($str, '/')) {
                $value->setStartFlag(false);
            }
        }

        return $value->render();
    }
protected function toRegex($str)
    {
        $value = Expression::create($str);

        if ($value->isGlob()) {
            $value = $value->getRegex();

            if (false === strpos($str, '/')) {
                $value->setStartFlag(false);
            }
        }

        return $value->render();
    }
protected function toRegex ( $ str ) { $ value = Expression :: create ( $ str ) ; if ( $ value -> isGlob ( ) ) { $ value = $ value -> getRegex ( ) ; if ( false === strpos ( $ str , '/' ) ) { $ value -> setStartFlag ( false ) ; } } return $ value -> render ( ) ; }
Converts glob to regexp.

PCRE patterns are left unchanged.
Glob strings are transformed with Glob::toRegex().

@param string $str Pattern: glob or regexp

@return string regexp corresponding to a given glob or regexp
Converts glob to regexp .