example of regex-based custom validator