Dextrin.Schema.Format (Dextrin v0.3.3)

Copy Markdown View Source

The formats a refine's format: names (DXNS.md §2a, Jan, 2026-10-20): a closed set, each checked the same way in every implementation. A format DXN has a tag for is read by that tag's reader; every other one by a grammar written as a regular expression that PCRE, JavaScript (with the u flag) and PHP all read alike.

Summary

Functions

Every format's name, sorted.

Whether text is in the format named name.

Functions

names()

@spec names() :: [String.t()]

Every format's name, sorted.

valid?(name, text)

@spec valid?(String.t(), String.t()) :: boolean()

Whether text is in the format named name.

iex> Dextrin.Schema.Format.valid?("semver", "1.2.3-rc.1")
true
iex> Dextrin.Schema.Format.valid?("hostname", "-a.example")
false