private function validateValue(string $name, string $value, string $pattern): void
    {
        if (!preg_match("#^$pattern$#", $value)) {
            throw InvalidAttribute::badFormat($name, $value, $pattern);
        }
    }