function scanf($format)
    {
        $spec_pattern = "/%[+-]?('.)?[-]?(\d)*(\..\d)?[%bcdeEfFgGosuxX]/";

        $source = substr($this->data,$this->pos);

        $result = sscanf($source,$format);

        if ($result==-1) return;
        else {
            $l = 0;
            foreach ($result as $v) {
                $l += strlen("".$v);
            }
        }

        $no_patterns_format = preg_replace($spec_pattern,"",$format);
        //echo "No patterns format : [".$no_patterns_format."] LEN=".strlen($no_patterns_format);
        $l+=strlen($no_patterns_format);

        $this->pos+=$l;

        return $result;
    }