Allow attributes to be validated against regexes

Here is the new patch using hashref(s) instead of arrayrefs. Please could you adjust the Pod as necessary.