protected static function compileValidPattern()
    {
        $user_info_pattern = UserInfo::getValidPattern();
        $host_pattern      = Host::getValidPattern();
        $port_pattern      = Port::getValidPattern();

        $reg_start = '/^$|^';   //allow for empty authority
        $reg_end   = '$/';

        self::$part_pattern =
            '((?\'user_info\'' . $user_info_pattern . ')@)?' .
            '(?\'host\'' . $host_pattern . ')' .
            '(:(?\'port\'' . $port_pattern . '))?';

        self::$valid_pattern = $reg_start . self::$part_pattern . $reg_end;
    }