I would like to validate the format of a form value, allowing an empty value or requiring a specific format.
To validate a value against a format, this works fine:
Add unless nil? || blank?, which should skip the validation if it's blank (empty) or nil, I believe.
unless nil? || blank?
See the last code example on this page.