def validate_re key, value, opts
      if opts[:re]
        if value.to_s !~ opts[:re]
          raise RegApi2::ContractError.new(
            "Field #{key} mismatch regular expression: #{value}",
            key
          )
        end
      end
      value
    end
def validate_re key, value, opts
      if opts[:re]
        if value.to_s !~ opts[:re]
          raise RegApi2::ContractError.new(
            "Field #{key} mismatch regular expression: #{value}",
            key
          )
        end
      end
      value
    end
Validates specified `value` with `re` field.
 @param [Object] key Value to validate.
 @param [Object] value Value to validate.
 @param [Hash] opts opts with optional re field.
 @raise ContractError