Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: On Validating Email Addresses

by diotalevi (Canon)
on Jan 05, 2005 at 06:27 UTC ( [id://419528]=note: print w/replies, xml ) Need Help??


in reply to Re^2: On Validating Email Addresses
in thread On Validating Email Addresses

What?! Email::Valid fails on embedded comments? That's an astonishingly common feature of actual email addresses in the wild. I managed a number of public inboxes for a global corporation for a few years and I had to take special care in my own email address parsing code (in a VB dialect) to handle comments.

I mean, of the form (Fname Lname) <addr@example.com> and <addr@example.com> (Fname Lname). I never saw addr@example( ... ).com. Of those three forms, which are supported? Anything good will handle the first two and I don't think the third matters. I'm speaking only from what I saw in actual usage.

Replies are listed 'Best First'.
Re^4: On Validating Email Addresses (s/embed/nest/)
by tye (Sage) on Jan 05, 2005 at 06:51 UTC

    s/embedded/nested/g

    The regex doesn't handle comments nested inside of comments. It does handle comments (one level deep only).

    - tye        

      I don't think I ever saw nested comments. Thanks for clarifying.
Re^4: On Validating Email Addresses
by hardburn (Abbot) on Jan 05, 2005 at 14:36 UTC

    Besdies tye's point below, I don't think it matters much in common usage of Email::Valid, anyway. I've only used it for validating form input, and I imagine this tends to be the most common case. How often do you type (Fname Lname) <addr@example.com> into a form? I always just type the address alone.

    "There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

      Ok, so you won't type that into a form. Your email client will happily give that string to me and its still subject to validity tests. Email::Valid should handle addresses as generated by backend systems and not just what people are likely to type into a text box.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-04-18 15:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found