In Magento 1, I used the below javascript code inside of a template to add my own validation rule:
// Add new validation class for the name. Also supports names with two hypen in the name e.g. Hans-Maier-Friedrich.
// Also supports umlauts and some special chars like é or á
Validation.add('validate-name','Please only use (A-Z a-z àèéáäÄüÜöÖ) in this field.', function(v) {
return Validation.get('IsEmpty').test(v) || /^[A-Za-zàèéáäÄüÜöÖ]+-?[A-Za-zàèéáäÄüÜöÖ]+-?[A-Za-zàèéáäÄüÜöÖ]+$/.test(v);
});
How does it work in Magento 2?