def validate_format(field, value, setting)
      result = value.nil? || setting.match(value).nil?
      add_message(field, "#{field.to_s} does not appear to be in the proper format.") if result
      return !result
    end
def validate_format(field, value, setting)
      result = value.nil? || setting.match(value).nil?
      add_message(field, "#{field.to_s} does not appear to be in the proper format.") if result
      return !result
    end
Validates contents of field against a given Regexp. This can be tricky because you need
 to anchor both sides in most cases using \A and \Z to get a reliable match.