Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Use \Z to match end of string or newline and \z to match only end of string.

I've long been under the impression that domain names are allowed to have a single trailing dot. That is, "example.com" is the same as "example.com.". As a lame proof of this, dig tells me gives me the same answer either way, but it rejects "example.com.." (not a legal name). I haven't looked closely at RFC1035 for support for this. If you accept this, it screws up the "lc eq lc" test for equality. Maybe you'd want to just s/\.?\s*$// everything before anything else.

Yes, I realize that it is possible to set up a system such that ExpertsExchange@example.com and ExpertSexchange@example.com are completely separate addresses, but anybody who does that deserves to suffer from such a set-up.

Unfortunately, it's usually not the people who set it up who suffer but rather the people who have to use it and often have no control over it. I don't think that ignoring the case of the local part of an email address is a bad design decision—I've done it myself at times. I think, rather, that it's better justified on the grounds that the few mistakes aren't worth the extra work to avoid them.

At YAPC::NA 2008, I attended a talk by Ricardo SIGNES (‎rjbs‎) called "Email Hates the Living!" which discussed some of the pitfalls of parsing email addresses strictly according to the standards. Google knows about it. You might pass that along to anyone else who wants to take an approach less practical than yours. Also, it's hilarious.


In reply to Re: Practical e-mail address validation by kyle
in thread Practical e-mail address validation by tye

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (1)
As of 2021-10-18 04:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (72 votes). Check out past polls.

    Notices?