How To Validate Person Names? - Python/django
Solution 1:
Don't.
Please, read this carefully: Falsehoods Programmers Believe About Names.
Solution 2:
I don't think it is a good idea.
What kind of names would you like to exclude? There is no international list of allowed characters for names and there is not much reason to disallow specific characters.
Solution 3:
I personally wouldn't bother about validating names, I guess there are so many possiblities it is very hard to maintain. If you could come up with a regular expression, I think it would be so generic it wouldn't be effective. The only thing I can think of as valuable is excluding things like @ # $ % ^
.
Just make sure you are escaping characters, if someone's name is Fooalert('lala'), that's fine, but make sure it's not parsed.
Solution 4:
Depending on your version of python it might be re.UNICODE you are looking for?
Post a Comment for "How To Validate Person Names? - Python/django"