A general openmrs field validator could take in a regular expression and an input string to validate any input field. An administration section could allow the administrator to add a field type, a regular expression, and an example format for as many input fields as desired. The openmrs validator could take in a string and the regex in order to validate the field. It might also be able to parse the regex so that when the user enters a value, what is entered is actually what gets filtered from the parser.
For person address, I am including a quick-fix patch that allows a regex and example format to be defined in the addressTemplate of openmrs-servlet.xml for any person address field. If the input does not match when editing a patient on the patient dashboard then the field(s) is/are highlighted, an error message is shown, and the page will not submit until the user enters the correct value. The patch directly applies to latitude and longitude values for the Kenya address template.