Test if Window Name contains multiple Srings

Hey, i have a problem.
I Have a short script that should close all Terminal Windows that does not contain Sting1 or String2.

With one String it’s no Problem:

tell application "Terminal" to close (every window whose name does not contain StringVar1)

But 2 Strings seems not to work. Or maybe i just dont know how to do it… Do you know how i could solve this Problem?

Thx, Nicolas

-- Close every window whose name contains neither StringVar1 nor StringVar2.
tell application "Terminal" to close (every window whose name does not contain StringVar1 and name does not contain StringVar2)


-- Close every window whose name either doesn't contain StringVar1 or doesn't contain StringVar2.
tell application "Terminal" to close (every window whose name does not contain StringVar1 or name does not contain StringVar2)