Searched the web to find a regex to validate visitor name input in two parts but did not have much luck.
A “two parts” visitor name means for example Joe Soap, Tom O'Fool, etc.
I want to accept A-Z, a-z letters the ‘symbol and at least one blank space.
I need something like the following to do the job
if( !preg_match("^[a-zA-Z'-]+$/i^", $vname) )
but this will not pass; it keeps returning message to input valid name.
Is there a simple workaround?
Try this: