Expand description
The hand-written format checks the rules are built on.
Laravel leans on PCRE for email, url, uuid and friends. Rustlavel has
no regex engine and does not want one, so each shape is a small function
here instead. They are deliberately pragmatic, not RFC-exhaustive: the job
is to reject the typos a user actually makes in a form, not to accept every
address RFC 5322 permits. Each function documents where it draws that line.
Functions§
- is_
alpha - Letters only. Unicode-aware, like Laravel’s default:
AdaandZoëboth pass. - is_
alpha_ dash - Letters, digits, dashes and underscores — the shape of a URL slug.
- is_
alpha_ num - Letters and digits only.
- is_date
- A calendar date in
YYYY-MM-DD, the format an<input type="date">sends. - is_
email - A practical email shape:
local@domain, one@, a domain with a real TLD. - is_url
- A URL with an explicit scheme and a non-empty host:
https://example.com/x. - is_uuid
- The
8-4-4-4-12hex shape of a UUID.