private function validateValue(string $name, string $value, string $pattern): void
    {
        if (!preg_match("#^$pattern$#", $value)) {
            throw InvalidAttribute::badFormat($name, $value, $pattern);
        }
    }
private function validateValue(string $name, string $value, string $pattern): void
    {
        if (!preg_match("#^$pattern$#", $value)) {
            throw InvalidAttribute::badFormat($name, $value, $pattern);
        }
    }
private function validateValue ( string $ name , string $ value , string $ pattern ) : void { if ( ! preg_match ( "#^$pattern$#" , $ value ) ) { throw InvalidAttribute :: badFormat ( $ name , $ value , $ pattern ) ; } }
Checks whether the value matches the regular expression.

@param string $name
@param string $value
@param string $pattern
@throws InvalidAttribute
Checks whether the value matches the regular expression .