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
The following expression will work on any language supported by UTF-16 and will ensure that there's a minimum of two components to the name (i.e. first + last), but will also allow any number of middle names.
/^(\S+ )+\S+$/u
At the time of this writing it seems none of the other answers meet all of that criteria. Even ^\p{L}{2,}$
, which is the closest, falls short because it will also match "invisible" characters, such as U+FEFF
(Zero Width No-Break Space).