Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
I'm open to suggestions on how to better validate real names. Perhaps looking for characters it may NOT contain would be a more versatile and language-friendly route.
After doing a bit of research, I think the best route to take is validate the fields against a regex blacklist of symbols and numbers. I have an initial regex that will roll on the next dev branch. I'm marking this issue as closed, if the regex can be improved, feel free to re-open or create a new issue.
Comments
Comment #1
sgerbino commentedOk, I've revised the regex to allow for accented characters, I'd just like some testing before I roll a stable release of it.
Comment #2
sgerbino commentedComment #3
sgerbino commentedComment #4
AlexDeRuyter commentedWhat about spaces in the lastname field ?
Comment #5
sw3b commentedThe feature need re-work. In french language a lot of person have name like
Firstname : Jean-Francois
Lastname : Le Premier
If the Use Realname registration validation is check I got these errors:
•First name must only contain letters.
•Middle name must only contain letters.
•Last name must only contain letters.
Thanks for your work !
Comment #6
sgerbino commentedComment #7
sgerbino commentedI'm open to suggestions on how to better validate real names. Perhaps looking for characters it may NOT contain would be a more versatile and language-friendly route.
Comment #8
sgerbino commentedFor now, I've modified the regular expression to allow for hyphens and spaces in the latest 7.x-2.x-dev branch.
Comment #9
sgerbino commentedComment #10
sw3b commentedOk I'll take a look thanks !!!
Comment #11
sgerbino commentedAfter doing a bit of research, I think the best route to take is validate the fields against a regex blacklist of symbols and numbers. I have an initial regex that will roll on the next dev branch. I'm marking this issue as closed, if the regex can be improved, feel free to re-open or create a new issue.