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
The correct way to validate names is:
\pM
, \pZ
, nor \pC
; i.e., is neither one of the combining marks, separators, nor other (usually control) characters. A character class like [^\pM\pC\pZ]
should suffice.There: easy as can be. You will probably need Ruby 1.9 to do this properly, though.