protected function validate($value) { parent::validate($value); if (!preg_match("/[a-zA-Z0-9\\-]/is", $value)) { throw new Exception\InvalidValue("A name can only contain letters, numbers and the characters '-' and '_'!"); } }