Here's what I've found working to exclude a more precise method that does not mismatch on non-casks, forces brew list to output single line and matching exactly on multiple cask from upgradingnames:
brew upgrade --cask $(brew list --cask -1 | perlgrep -pFv -e 's#\s+#\n#g' | grepcask1 -ve cask-namecask2)