Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: email check

by FoxtrotUniform (Prior)
on Jul 18, 2002 at 20:31 UTC ( [id://183038]=note: print w/replies, xml ) Need Help??


in reply to email check

Get yourself a copy of RFC 2822. (Don't forget to allow for obsolete addresses; not everyone has read this RFC yet.) If you have access to the O'Reilly book Mastering Regular Expressions, there's a regex in the back of the book that does an incomplete job of checking email addresses, but is about as close as you can get with a plain regex. (Be warned, it's 6598 characters.)

Why don't you want to use a module?

Update: If you want to do email verification by hand, the best advice I can give you is to study RFC 2822 thoroughly. You'll also find Text::Balanced useful for pulling apart the address.

--
The hell with paco, vote for Erudil!
:wq

Replies are listed 'Best First'.
Re: Re: email check
by mr2 (Friar) on Jul 18, 2002 at 21:12 UTC
    "Why don't you want to use a module?"

    well i like to understand ... not just using somoene's
    written module... i'm not trying to write some very short
    script ... because it's very practically for me to write
    something hard(interesting) myself because it's good ...
    it help's inprove'ing my skills.

      What's the difference between using a module and copying code someone here gives you then? If you want to understand, just read the module. Reading code also helps improve your skills -- especially if you're going to be doing any serious programming in the future.

      While I personally don't mind recreating the occasional wheel, I think this might be a bit much. You'll need to read the RFC and fully understand all of it to determine what you'll need to do. There's a million halfassed ways of doing it (I've been guilty of this myself) but you probably would be better served just using the module and picking a more useful wheel to recreate that will give you the opportunity to learn more than the intimate details of parsing email addresses.

      -Lee

      "To be civilized is to deny one's nature."

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2025-05-14 04:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.