I need a regular expression to validate the Spanish passport code with jQuery.
This is my function.
$.validator.addMethod('pasaporte', function(value,element){
return this.optional(element) || /^[a-zA-Z0-9]{5,10}$/.test(value);
});
I need the patterns that the passport code follows as well as the type of DNI format of Spain.
For example.
AAA123456A