private static function parseVariablePattern(string $patern) : array
    {
        static $supported_types = [
            'string',
            'integer',
            'int',
            'float',
            'double',
            'boolean',
            'bool',
        ];
    
        $tmp = explode(':',$patern);
        $varname = $tmp[1] ?? null;
        $regex   = $tmp[2] ?? null;
        $type    = $tmp[3] ?? null;
        
        if (!preg_match('/^[a-zA-Z_][0-9a-zA-Z_]*(\[\])?$/',$varname)){
            throw new RoutingRuleParseException($patern, "illegal variable name: $varname");
        }
        if ($regex && !preg_match('/^[0-9a-zA-Z@#_=%\\\^\$\.\[\]\|\(\)\?\*\+\{\}\^\-]*$/',$regex)){
            throw new RoutingRuleParseException($patern, "illegal variable regex pattern: $regex");
        }
        if ($type && !in_array($type,$supported_types)){
            throw new RoutingRuleParseException($patern, "unsupported variable type: $type");
        }
        
        $res = [];
        
        if ($varname){
            $res['varname'] = $varname;
        }
        if ($regex){
            $res['regex'] = $regex;
        }
        if ($type){
            $res['type'] = $type;
        }
    
        return $res;
    }