I am using this regex to make sure that names can only contain letters, apostrophe or hyphen.
Validator::extend('people_names', function($attribute, $value, $parameters, $validator) {
return preg_match("^[a-zA-Z-'\s]+$^", $value);
When I use this tool to check if the regex is correct, it shows its correct, but in my form when I test an input starting with digits or any other characters like 123name
or #$#$name
it passes while it should not. An input with letters then digits like name123
is rejected.