Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^5: Please evaluate: RegEx for validating e-mail addresses

by davido (Cardinal)
on Sep 26, 2004 at 01:22 UTC ( #393862=note: print w/replies, xml ) Need Help??


in reply to Re^4: Please evaluate: RegEx for validating e-mail addresses
in thread Please evaluate: RegEx for validating e-mail addresses

I do understand the point you're making; that sometimes there is a "good enough" solution, especially where a full RFC implementation seems like overkill in the context of a more closed environment.

But you mentioned that you've seen what happens when two MTA's can't agree on what is and is not valid. I imagine that can be quite a problem. So why make things worse by supporting the building of solutions that fail to meet the RFC? If a particular network is going to send and receive email over the internet, or if a webpage is going to be validating email addresses that are to be valid on the internet, a mostly-correct solution is going to be somewhat-incorrect. I know that CGI Programming with Perl suggests a mostly-correct solution for matching email addresses. But there exists (in the CPAN modules) solutions that are fully correct. If writing ones' own fully-compliant solution is too much work, there's always those modules.

The OP suggested that he couldn't use modules because this ultimately will be ported to another language. ...well at least learn from the modules out there how to go about the task. Or invoke Perl from that other language's code to perform the test. ...or ask the question in a PHP-oriented group, where undoubtedly it has been answered before. ;)


Dave

  • Comment on Re^5: Please evaluate: RegEx for validating e-mail addresses

Replies are listed 'Best First'.
Re^6: Please evaluate: RegEx for validating e-mail addresses
by Limbic~Region (Chancellor) on Sep 26, 2004 at 14:09 UTC
    Dave,
    If a particular network is going to send and receive email over the internet...

    DaWolf didn't indicate what purpose the email validator was going to be used for. That is why I said "context is important". I should likely have said without knowing the context, it is impossible to say how close to the RFC you need to get. I gave two examples in my reply to merlyn of where local context would be a factor, but I admit that it is just as probable that the form was to validate the "from" address of a form mailer and should be full RFC compliant.

    Now that the context is known, the possibilities I presented are pointless.

    Cheers - L~R

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2022-05-23 23:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (82 votes). Check out past polls.

    Notices?