Page 1 of 1
How to Validate Full Name
Posted: Tue Nov 02, 2010 10:26 pm
by chizeng
Hi all,
I am looking for a regex pattern to validate names, full or abridged, such as:
Sam Johnson Jr.
Mr. O' Dougell
sam thayer
jack
So basically only alphabetic and space characters except for " ' " and "." .
Does anyone have any suggestions?
Thanks so much.
Re: How to Validate Full Name
Posted: Wed Nov 03, 2010 1:38 pm
by Sofw_Arch_Dev
So basically only alphabetic and space characters except for " ' " and "." .
Sounds like you have a handle on it already. What have you tried so far? You don't seem to be enforcing or expecting capitalization. Are you planning on validating the name or name parts against a dictionary? Without a dictionary anything you write will probably have to allow junk names.
Re: How to Validate Full Name
Posted: Wed Nov 03, 2010 8:27 pm
by Jonah Bron
[a-zA-Z\.'\s]{2,60}
Any of the given characters, (a-z, A-Z, escaped period, apostrophe, any whitespace character) occurring between 2 and 60 times.
Re: How to Validate Full Name
Posted: Fri Nov 05, 2010 3:59 pm
by MichaelR
Re: How to Validate Full Name
Posted: Fri Nov 05, 2010 5:22 pm
by Apollo
chizeng wrote:Does anyone have any suggestions?
Yes: don't do it. My neighbour (whose name is 张張刘劉) might want to use your website as well!
What, you're only aiming at western people? My uncle from Iceland (whose name is Friðrik Þór Guðnæson) might want to use your website as well
