Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Shuckin' the Email Addy

by chromatic (Archbishop)
on Sep 07, 2000 at 06:17 UTC ( [id://31354]=note: print w/replies, xml ) Need Help??


in reply to Shuckin' the Email Addy

Note that the perlfaq correctly notes that there is no simple regex to match an RFC-822 compliant e-mail address. Please note this!

With that in mind, if your data file is as simple as what you say, I would do something like this:

(undef, $address, undef) = split '', $line;

I wouldn't bother with trying to match anything else, I'd just split. Again, this depends on your text file being *very* simple, as simple as you've described it above.

For anything else, the modules Email::Find and Email::Valid might come in handy.

Replies are listed 'Best First'.
RE: Re: Shuckin' the Email Addy
by Fastolfe (Vicar) on Sep 07, 2000 at 17:14 UTC
    There is a module EMail::Find specifically for searching text for e-mail addresses. I don't know how well it works. It does come with RFC822 validation code (Email::Valid, mentioned elsewhere), though. There is also a module RFC::RFC822::Address that checks (strictly) for the validity of an RFC822 e-mail address.
RE: Re: Shuckin' the Email Addy
by Anonymous Monk on Sep 07, 2000 at 06:53 UTC
    chromatic, that is exactly what I need!

    Thanks.

    By the way, you're advisory about trying to validate e-mail addresses is well-taken, but the format of the source file is pretty simple so your split idea should fit the bill.

    Thanks again.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://31354]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-24 20:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found