0

I'm designing a sign up form which has to imitate Facebook's policies toward the user's first and last name.

Facebook has quite a long list of DONT's one needs to take care of when entering their first and last name at sign up. Are there any Java packages available that can help me stick to these guidelines? The guidelines are that one should refrain from adding any of these to their name:

  1. Symbols, numbers, unusual capitalization, repeating characters or punctuation.
  2. Characters from multiple languages.
  3. Titles of any kind (ex: professional, religious).
  4. Words, phrases or nicknames in place of a middle name.'
  5. Offensive or suggestive words of any kind.
CBroe
  • 82,033
  • 9
  • 81
  • 132
Hassan Baig
  • 12,135
  • 18
  • 66
  • 155
  • Short Answer: No. 1-2: You can do that easily using Regex (http://stackoverflow.com/questions/15805555/java-regex-to-validate-full-name-allow-only-spaces-and-letters) 3-5: You need a big database of words to match against name, best to keep that on server and match against names when saving. – Sharj Jul 13 '15 at 01:00
  • Okay that's a start. I'll search for databases for 3-5. I was hoping there'd be some kind of well-known library out there that handles most of these name validation issues. Seems there isn't. – Hassan Baig Jul 13 '15 at 02:21

2 Answers2

0

I am not aware of any such existing libraries or frameworks that support that level of scrutiny over a persons name. Most likely Facebook built it in house for their very specific requirements.

May I make a slightly off topic suggestion? I would abandon this "requirement".

No doubt false-positives (users who have legitimate names who you have rejected on the basis that the name 'looks unusual') would drive away people from other languages/cultures.

Facebook can only get away with this because they are a juggernaut. You are not Facebook. On Facebook the user is already following a carrot (maybe their friends are telling them to make an account, or it is a requirement for some other site, etc.) and will circumvent the name limitations if necessary.

On your site/app the user will probably just add to your bounce rate. You must tread extremely carefully when welcoming a new user to your site and be very careful not to give them a reason to abandon your registration. Avoid any form of scrutiny unless it is absolutely necessary.

Regarding the example guidelines...

  • With Guideline #1, obviously false symbols and numbers are safe scrutiny. But the other requirements are commonplace in names of people in other cultures.
  • Guideline #2 shows a blatent disregard for other cultures, and I personally find it a little bit racist.
  • Guideline #3 specifies that no titles are allowed. Are you telling me I can't have acknowledgement of title on your site/app? Why? For what reason may I not be referred to as 'Dr. John Smith'? Just seems like a frivolous rule...
  • Guideline #4 I can't imagine is even possible without human intervention. I imagine English words are common place as middle names, but 'Eye Pea Freely' is an obvious forgery (or is it? can you be 100% certain it's not an actual name?)
  • Guideline #5 is probably the most reasonable rule, which you could probably enforce with some dictionary checking (lots of free dictionary data sets out there on Google). However, it's still almost impossible to police.
Community
  • 1
  • 1
1owk3y
  • 963
  • 1
  • 9
  • 28
0

Let's assume its an absolutely critical requirement to validate names exactly like Facebook does. Why not use cross-site AJAX requests to mimic a registration and check the result?

enter image description here

The only issue is, if it passes validation, it will create a Facebook account. So maybe you could tweak it so that it leverages an already-registered user changing their name?

It's probably not practical, but neither are your validation requirements.

1owk3y
  • 963
  • 1
  • 9
  • 28
  • In this scenario, 1) we'd need to produce ghost data to fill out the rest of the form, in order to validate the name field via piggy backing on Facebook's validation process. 2) This process produces a Facebook account every time. 3) Too many retries and Facebook tags your address. If we ignore (2) & (3), and just talk about (1), it's a creative way of thinking, but not quite there yet. There's got to be a way to piggyback Facebook's name validators without needing to produce ghost data for all other fields. – Hassan Baig Jul 14 '15 at 06:21
  • What about an already registered user changing their name? Much less likely to have the same monitoring or limitations on it – 1owk3y Jul 15 '15 at 06:35
  • You could try a bounty if you really want to dig deep, but you'll need more points on StackExchange. Hope you find a better solution out there! – 1owk3y Jul 17 '15 at 06:31