in reply to How can I extract the username and hostname/domain from e-mail addresses?

/<(.+?)@(.+?)>/
$1 should contain the user
$2 should contain the domain

Replies are listed 'Best First'.
Re^2: How can I extract the username/domain?
by vaflinux (Initiate) on Jun 23, 2011 at 10:49 UTC
    $1 and $2 doesn't print anything. its ooutpu is blank. Pls provide me the full code.
Re^2: How can I extract the username/domain?
by vaflinux (Initiate) on Jun 23, 2011 at 11:21 UTC
    $1 and $2 not providing any output. it is giving blank output. My code is: $email = "old@oldone.com"; if ($email =~ /(^@+)@(.+)/) { #if ($email =~ /<(.+?)@(.+?)>/) { print "username is $1\n"; print "hostnmae is $2\n"; }