It it's really that complicated, I think the concept of email address needs to be redefined to be "the bits wrapped around the @", and put the username somewhere else.
Not that you can't write a regular expression to say "anything at all goes here" but then you have to start working from the other end, "anything at all except for the @ symbol", etc.
Ooo! Did I mention we have people with @ in their names?
Did I mention we have people with @ in their names?
One user. I'm sure we could ask him to change it.
Yeah, that's a good idea.
How hard would it be to make some characters illegal in usernames?
I'm still a bit confused as to why we're recording, or using, people's names in the format:
John H <john@something.com>
surely if we just use the
john@something.com
bit the problem goes away?
Or, alternatively, why don't we run a quick regex over the name we're inserting, the bit in red here:
John H <john@something.com>
so that, even if my chosen username is:
J_@h.n _.*._ ~-H-~
it gets stripped back to the legal characters before being used.
once again watching in fascination as the great minds speak in unknown tongues and wave their hands in mystic configurations
This is all reminding me of how much I enjoyed my Perl class. I only wish I had some practical application for it at the moment. (For the fun, plus the possibility of a paycheck.)
Robert, if you're interested in Perl, you should check out Perlmonks, [link] -- lots of good stuff and helpful people. It's like here, only with less Buffy.
I fixed the punctuation problem on the voting page. The validation now occurs
before
appending the user name to the email.