What is allowed for first name and last name?

Acceptable: Any unicode letters, spaces, apostrophes, and hyphens where the name is at least 2 characters in length. Note that capitalization does not factor in to the validation of the names.
Examples: TJ Smith, Jason Alexander De'Fry-Baker, WILLIAM STONE SR

Unacceptable: Any non-unicode letters such as numbers, symbols, or punctuation.
Examples: T.J. Smith, Daria Test2, John? Doe, William Stone Sr.

The regex Root uses to validate first and last names:
(?-mix:\A[\p{L}'\- ]{2,}\z)

Breakdown of the regex:

\AMarks the start of the string.
\p{L}Matches any unicode letter, uppercase or lowercase.
'Allows for an apostrophe in the name.
\-Allows for a hyphen in the name.
spaceAllows for a space in the name.
{2,}Allows for any combination of the above that is at least 2 characters in length.
\zMarks the end of the string.

You can verify any names in the following site. It has our regex pre-populated.
https://rubular.com/r/GgnVu77ywqZMSk


Did this page help you?