December 31st, 2012, 11:28 PM
Asking for opinions on name validation
Should I assume it possible for people to have 1-letter names for the website I'm building, or should names be required to be at least 2 characters long? Should I allow underscores in a name, or any other characters in particular? Reasons with opinions please.
December 31st, 2012, 11:45 PM
Well in reality, parents can name their children whatever they like. However, I've never seen a name with just one letter.
I don't thing allowing users to use 1 letter names will do any harm (unless your target users are 12 year old girls under the delusion of Justin Beiber being their husband..).
But I would go with two letters as the minimum. Just because I think it's very unusual for someone to have a name containing just one letter.
I don't see why you should allow underscores. But you should allow hyphens and dots (.).
January 1st, 2013, 12:21 AM
Thanks, I wouldn't have thought to include dots of hyphens! I can see why that would make sense. I'd also like to add to this thread that in my current regex I've also included accented vowels. I might as well post it in case anybody here may find it useful:
January 1st, 2013, 01:25 AM
arbitrarily choosing a few diacritics doesn't make a lot of sense, because there are many more of them (depending on the language).
Is this about real names or just user names? For user names, I'd only allow the alphanumerics (and maybe spaces) to ensure distinguishable and easy to type names. For real names, you probably want the printable characters from the first few blocks of the Basic Multilingual Plane plus spaces.
But be aware that "advanced" characters can be misused. For example, ligatures (letters composed from multiple characters) might be indistinguishable from a simple sequence of their components. So users might be able to "steal" the names of other users.