Validate a value against set rules.