$q{'command'} =~ /^(search|\s*)$/; $command = $1; # $command is now untainted.