my $regex = '.(?!evil)'; if ("this is so evil" =~ /($regex)/) { print "yay: $1\n"; }