You could also use `validate_re($protocol, '(tcp|udp)')` to verify that `$protocol` is one of the supported types.