View Source Moar.UUID (Moar v1.56.0)

UUID-related functions

Summary

Functions

Returns a regex that will match a UUID

Returns true if the given UUID is a valid regex, or false if it is nil or an invalid regex.

Functions

@spec regex() :: Regex.t()

Returns a regex that will match a UUID

@spec valid?(nil | binary()) :: boolean()

Returns true if the given UUID is a valid regex, or false if it is nil or an invalid regex.

iex> Moar.UUID.valid?(nil)
false

iex> Moar.UUID.valid?("cows")
false

iex> Moar.UUID.valid?("a3357225-ed23-48b6-9ce5-10a580489b3f")
true