I need a regular expression that will match a string similar to this...
me@foo.org_you@foo.com_This is the subject_00298284384.eml
I want to match the From, To, and Subject fields. I was using split and splitting on the _, but that doesn't work when you have email addresses with _'s.
($from, $to, $sub, $crap) = split(/_/, $str, 4)
I want to use a regexp to match the first 3 fields only. This doesn't work...
if ($str =~ /^(\w+@\w+)_(\w+@\w+)_(\.*?)_\.*/)
$from = $1
$to = $2
$subject =$3
Thanks,
Chris
me@foo.org_you@foo.com_This is the subject_00298284384.eml
I want to match the From, To, and Subject fields. I was using split and splitting on the _, but that doesn't work when you have email addresses with _'s.
($from, $to, $sub, $crap) = split(/_/, $str, 4)
I want to use a regexp to match the first 3 fields only. This doesn't work...
if ($str =~ /^(\w+@\w+)_(\w+@\w+)_(\.*?)_\.*/)
$from = $1
$to = $2
$subject =$3
Thanks,
Chris