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 regex work for me (was using in Angular 8) :
([a-zA-Z',.-]+( [a-zA-Z',.-]+)*){2,30}
It will be invalid if there is:-
Any whitespace start or end of the name Got symbols e.g. @ Less than 2 or more than 30
Example invalid First Name (whitespace)
Example valid First Name :