Validate a value against a set of rules.