if($condition ne 'SN' && $condition ne 'SU') { ... } # of if you like your regexes if($condition !~ /^S[UN]$/) { ... }