in reply to Regex matching a string beginning with "root: " but not containing another string

Do you mean something more complex than:
my $email = 'myself@domain.of-my.own'; if (/^root:(?!.*\Q$email\E)/) { ... }
or am I missing something here?

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

  • Comment on •Re: Regex matching a string beginning with "root: " but not containing another string
  • Download Code

Replies are listed 'Best First'.
Re^2: Regex matching a string beginning with "root: " but not containing another string
by ysth (Canon) on Sep 09, 2004 at 19:01 UTC
    That would not work correctly given notmyself@domain.of-my.own.doing. You need to put whatever characters (or \z) delimit the email address around the \Q \E.