Ecto.Changeset.validate_format

You're seeing just the function validate_format, go back to Ecto.Changeset module for more information.
Link to this function

validate_format(changeset, field, format, opts \\ [])

View Source

Specs

validate_format(t(), atom(), Regex.t(), Keyword.t()) :: t()

Validates a change has the given format.

The format has to be expressed as a regular expression.

Options

  • :message - the message on failure, defaults to "has invalid format"

Examples

validate_format(changeset, :email, ~r/@/)