my $email = 'myself@domain.of-my.own'; if (/^root:(?!.*\Q$email\E)/) { ... }