How can I validate a name, middle name, and last name using regex in Java?

后端 未结 3 2004
栀梦
栀梦 2020-12-22 09:21

I get a list of names and need to validate them. Some examples:

  • Elizabeth T. Bang
  • Elizabeth Bang
  • Zaki M. F. El-Adawy
  • joseph m. pasto
3条回答
  •  情深已故
    2020-12-22 09:48

    Why do you need to validate names? To catch typos or people just mashing the keyboard? Is it really worth the risk to reject a legitimate customer with an unusual name? There are people with no middle name or more than one, people who only have one name altogether, people who insist on having their title used everywhere, and of course all kinds of non-ASCII characters.

提交回复
热议问题