LA.pm: Regex

Arkadiy Sudarikov asudarikov at xceed.com
Fri Jul 20 19:37:26 CDT 2001


Dear all,

If I need to get name and email, then what's the regex?


I have 'Last name, First name <email at server.com>'.

I need 'Last name, First name', 'email at server.com'.

I use this,

if ($sender=~ m/^(.+)\s*\<(.+\@.+)\>$/) {
 print p $1;
 print p $2 }

But there is problem with space between name and email, between '... name
<...'.

Suggestions, anyone?



More information about the Losangeles-pm mailing list