I seem to recall you asked about performance recently the regex engine has a significant overhead. Your regex is equivalent to
$Terminal.contains('xterm' | 'linux') though of course if you only test this once at the beginning of the program, you can ignore that.