@psalm-pure
string $value:
string $pattern:
string $message:
InvalidArgumentException
public static function regex($value, $pattern, $message = '') { if (!\preg_match($pattern, $value)) { static::reportInvalidArgument(\sprintf($message ?: 'The value %s does not match the expected pattern.', static::valueToString($value))); } }