Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

•Re: Regex matching a string beginning with "root: " but not containing another string

by merlyn (Sage)
on Sep 09, 2004 at 16:22 UTC ( [id://389765]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://389765]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-24 03:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found