I have a single input where I need the user to type the first and last name. But I need a validation, I need to check that the first two words have at least three characters.
For example, if I type "Joe Do" or "Jo Doe" or even "Jo Do" I return a boolean value with the value false.
I tried using the following regex:
isValidName= /^(\w{3,20})(\s)(\w{3,20})$/g.test(name)
However, if I type a third string the validation stops working.
I have little knowledge with regex, so thanks in advance for any kind of help.