Advice on how to validate names and surnames using regex

前端 未结 3 1416
我在风中等你
我在风中等你 2021-01-07 05:22

I want to validate name and surname for my Ruby on Rails 3 application and so I have posted this question. Someone adviced me to read the Falsehoods Progra

3条回答
  •  梦谈多话
    2021-01-07 05:44

    The simple answer is, you cannot validate names and surnames other than to verify they are not null*. By filling in a form that asks for a name, somebody is declaring "this is my name", and if someone says "this is my name", you should believe them because they are the ultimate authority of what is their name.

    * even then, it's perfectly valid for people to have a single name rather than two or three, and there has been one instance of an individual who didn't actually have a name. He gave himself a symbol instead.

提交回复
热议问题