I want to create a Regular Expression for First Name and Last Name Only with only 2 words with only 1 Space.
Currently my regular expression is here : https://regex101.com/r/WigXOo/1
I have tried the below regular expression:
[A-Z][a-z]+(\s|,)[A-Z][a-z]{1,19}
it is validating correctly :
Sunil Kumar (Correct)
But it is allowing third Name like: Sunil Kumar 123 (Correct)
I want my results like below :
Correct Output:
Sunil Kumar (correct)
InCorrect Output:
Sunil Kumar 123 (incorrect) (I want only first and second name)
SUnil Kumar (incorrect) (needed only 1 letter from 1st name and 2nd letter from second name would be capital)
Sunil Kumar (incorrect) (needed only single space between 1st and 2nd name) (there are 2 spaces between first name and second name)
Please help.