Earlier quoted context omitted.
Is name validation even possible?
If you just use the {Alphabetic} Unicode character class (100K code points), together with a space, hyphen, and maybe comma, that might get you close. It includes diacritics. I'm curious if anyone can think of any other non-alphabetic characters used in legal names around the world, in other scripts? I wondered about numbers, but the most famous example of that has been overturned: "Originally named X Æ A-12, the chi…
Charset="WTF-8"
31–40 of 463 posts
Re: Charset="WTF-8"
#32Earlier quoted context omitted.
name.Length > 0 is probably pretty safe.
That only works if you’re concatenating the first and last name fields. Some people have no last name and thus would fail this validation if the system had fields for first and last name.
Re: Charset="WTF-8"
#33How do I allow "stępień" while detecting Zalgo-isms?
n=1 is probably a reasonable falsehood to believe about names until someone points out that language X regularly has multiple combining modifiers in a row, at which point you can bump up N to somewhere around the maximum number of combining modifiers language X is likely to have, add a special case to say "this is probably language X so we don't look for Zalgos", or just give up and put some Zalgo in your test corpus, start looking for places where it breaks things, and fix whatever breaks in a way that isn't funny.
Re: Charset="WTF-8"
#34How do I allow "stępień" while detecting Zalgo-isms?
If you really think you need to programmatically detect and reject these (I'm dubious), there is probably a reasonable limit on the number of diacritics per character.
Re: Charset="WTF-8"
#35A coworker once implemented a name validation regex that would reject his own name. It still mystifies me how much convincing it took to get him to make it less strict.
Re: Charset="WTF-8"
#36Earlier quoted context omitted.
That only works if you’re concatenating the first and last name fields. Some people have no last name and thus would fail this validation if the system had fields for first and last name.
some people have no name at all
Re: Charset="WTF-8"
#37I thought this was https://simonsapin.github.io/wtf-8/
Re: Charset="WTF-8"
#38Re: Charset="WTF-8"
#39Re: Charset="WTF-8"
#40How do I allow "stępień" while detecting Zalgo-isms?