"Dan" schreef:

Please don't top-post.

> "name" <[EMAIL PROTECTED]>
> the question was pertaining to get 'name' out of "name" at the start,
> and the email address out of the <<>> brackets. however i managed to
> figure that one out by playing.

Don't play but use Regexp::Common::Email::Address
http://search.cpan.org/search?m=module&q=Regexp::Common::Email::Address


> say for example, the subject said:
> item no.00001313131 - notification of an instant payment received
> from ebay_user ([EMAIL PROTECTED])

Use something like

  if ( /^Subject:\sitem no[.](\d+)\s-\s
         notification\sof\san\sinstant\s
         payment\sreceived\sfrom\s
         (.*?)\s
         [(]([EMAIL PROTECTED])[)]$/x )
  {
    print "item:$1, name:$2, address:$3\n";
  }

(untested)

If the length of some of the \s (whitespace) can be >1, make those \s+.

-- 
Affijn, Ruud

"Gewoon is een tijger."



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to