$.validator.addMethod(\'AZ09_\', function (value) {
return /^[a-zA-Z0-9.-_]+$/.test(value);
}, \'Only letters, numbers, and _-. are allowed\');
A more generic way of matching hyphens is by using the character class for hyphens and dashes ("\p{Pd}" without quotes). If you are dealing with text from various cultures and sources, you might find that there are more types of hyphens out there, not just one character. You can add that inside the [] expression