For website validation purposes, I need first name and last name validation.
For the first name, it should only contain letters, can be several words with spaces, an
This is what I use.
This regex accepts only names with minimum characters, from A-Z a-z ,space and -
.
Names example:
Ionut Ionete, Ionut-Ionete Cantemir, Ionete Ionut-Cantemirm Ionut-Cantemir Ionete-Second
The limit of name's character is 3. If you want to change this, modify {3,} to {6,}
([a-zA-Z\-]+){3,}\s+([a-zA-Z\-]+){3,}