Article View: pl.comp.lang.perl
Article #1215Re: mail
From: Piotr Piatkowski
Date: Tue, 14 Apr 1998 17:51
Date: Tue, 14 Apr 1998 17:51
48 lines
2315 bytes
2315 bytes
rafamiga@bofh.org.pl <rafamiga%bofh.org.pl@f33.n480.z2.fidonet.org> wrote:
: Ma ktoś magiczny regexp na łuskanie e-maila? Musi brać linię z
: "From: ", a więc powinien wyłuskać mi e-mail z "From: test@ala.ma.kota" oraz z
: "From: Testowy Gajowy <test@ala.ma.kota>". Oczywiście, nie wolno zakładać,
: że przed małpą jest tylko jeden wyraz, bo inszej nasz "testowy.gajowy"
: bardzos się zdziwi. Nie śpieszy się z tym i teorerycznie mógłbym sam, ale po
: co mam odkrywać amerykę w konserwach... 8^)
Poszukaj w ftp://ftp.pk.edu.pl/pub/lang/perl/CPAN/modules/by-module/Mail/,
wszystko powinno być w MailTools-1.10.tar.gz, w szczególności:
NAME
Mail::Address - Parse mail addresses
DESCRIPTION
Mail::Address extracts and manipulates RFC822 compilant
email addresses. As well as being able to create
Mail::Address objects in the normal manner, Mail::Address
can extract addresses from the To and Cc lines found in an
email message.
[...]
parse( LINE )
Mail::Address->parse($line);
Parse the given line a return a list of extracted
objects. The line would normally be one taken from a
To,Cc or Bcc line in a message
METHODS
phrase ()
Return the phrase part of the object.
address ()
Return the address part of the object.
comment ()
Return teh comment part of the object
etc...
--
Piotr Piątkowski, Uczelniane Centrum Informatyki, AGH Krakow, POLAND
Technical Details
Message-ID:
<6h07mn$jfq$1@galaxy.uci.agh.edu.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!news.icm.edu.pl!ict.pwr.wroc.pl!agh.edu.pl!agh.edu.pl!not-for-mailReferences:
<GoldED.199804111150342506.rafamiga@bofh.org.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!news.icm.edu.pl!ict.pwr.wroc.pl!agh.edu.pl!agh.edu.pl!not-for-mail From: Piotr Piatkowski <kompas@galaxy.uci.agh.edu.pl> Newsgroups: pl.comp.lang.perl Subject: Re: mail Date: 14 Apr 1998 19:51:19 +0200 Organization: University of Mining & Metallurgy Lines: 48 Distribution: world Message-ID: <6h07mn$jfq$1@galaxy.uci.agh.edu.pl> References: <GoldED.199804111150342506.rafamiga@bofh.org.pl> NNTP-Posting-Host: galaxy.uci.agh.edu.pl Mime-Version: 1.0 X-Newsreader: TIN [UNIX 1.3 unoff BETA 971018; sun4m SunOS 5.5.1] Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit