Email address regular expression
Lately, I’ve noticed three frustrating things about email addresses in web forms. All originate in ignorance on the part of the web designer. Time for a clue, folks.
- URLs are really simple: you’ve got letters, numbers, and hyphens, and some pretty simple rules about where they can occur. The rules about what’s truly legit in an e-mail address are actually a mind-numbingly complex, meaning if you’re going to use regex to validate it (whether client-side or server-side), you might as well piggyback on someone’s else’s work. This is the best email address regular expression I’ve found. Use it!
- Email addresses can be long. My junkmail address is 37 characters long.
maxlength="30"in your <form> makes me angry. - Email addresses can have subdomains. If you’re using the regex from #1, this is no problem. But for some reason, a few n00bish developers out there seem to think addresses have to take the form of username@site.com and complain about username@subdomain.site.com. That’s really inexcusable.
July 28th, 2005 at 9:06 am
you know what really takes my hide about online fields? Ok, i’ll tell ya… When logging into a site and the password field is set to a limit longer than the passwords are allowed to be.
An example: Let’s say i like to have a password that is greensunnytomatofries738 and I prefer that to be my password that I tend to use on sites. But then some sites only let you have a password that is 7-10 characters. Sot hen i limit it down to green738 for those lamo sites that limit password length. Then we visit that site. Oh i forget my password. I’ll just use my default greensunnytomatofries738 password. And the field lets me enter it even though they have a limit of 7-10 characters.
If your password limit is 10 characters why have your password field limit be larger than 10 characters. That is so LAME!
July 28th, 2005 at 9:07 am
I should write a whole post on these types of things that frustrate me, but I’ll just throw them all here.
I get sick of the webforms that ask for your email address in duplicate. It’s not a bad idea, but the odds are that I will copy & paste what I wrote initially. So the odds of preventing an error are roughly the same as before. And where’s the Firefox extension to automatically take care of this silliness?
Password rules. For one domain my password will be too simple. For others it is too complex. If I choose for my password to be “password”, warn me, but let me keep it if I’m stupid enough to.
Printed address forms. For a rebate last year I received a form with individual spaces for each L E T T E R. That’s fine until I can’t fit the first line of my address on the “street” line. And there was no 2nd line for my apartment number. And the 10 spaces for the city was far exceeded by what is required to write Charlottesville.
But why do I really need to write the city and state anyway if I know the zip code?
And for a new possibility, let people pick a “mail number.” Like a cell phone # that you can take with you where ever you go, or forwarded email address, get a # that will go to you no matter where you live as long as you keep it updated. Instead of telling everyone with whom you do business that your address changed, just change the forwarding address with the Post Office.
February 16th, 2007 at 11:05 am
On the contrary, I find the feature too be moderately useful. Many would agree that taking your hands off the keyboard to select the field with your mouse, then copy and paste it, is more hassle than just pressing and typing it again. Just yesterday such a feature caught me from submitting an incorrect email address, which would have rendered my account on that website useless.
February 16th, 2007 at 11:09 am
Ah, I meant “just pressing <tab>”. Those angle brackets, you know.
Also, there is no such Firefox extension, because everyone else has found the appropriate checkbox in their privacy settings.