public static function tokenize($pattern, $delimiter = '/')
    {
        // Checks if the pattern has some optional segments.
        if (count(preg_split('~' . static::PLACEHOLDER_REGEX . '(*SKIP)(*F)|\[~x', $pattern)) > 1) {
            $tokens = static::_tokenizePattern($pattern, $delimiter);
        } else {
            $tokens = static::_tokenizeSegment($pattern, $delimiter);
        }
        return [
            'optional' => false,
            'greedy'   => '',
            'repeat'   => false,
            'pattern'  => $pattern,
            'tokens'   => $tokens
        ];
    }