I'm using the following rule in jquery validate to make a name field, called nombre, only accept letters.
jQuery.validator.addMethod("nombre", function(value, element, param) {
return jQuery.trim(value).match(new RegExp("^(?:" + param + ")$"));
});
$("#nombre").rules("add", { nombre: "[a-zA-Z]+"})
I want the regex to accept something like
Polly Jean Harvey
or
P.J. Harvey
as valid names, (they are currently rejected). How can I add space between words and periods to the regex? Of course, I still want to reject blank names.