Hardcoded: /^root:(?!\s*admin\@somewhere\.here)/ Variable: my $admin_email = 'admin@somewhere.here'; /^root:(?!\s*\Q$admin_email\E)/