Skip to main content

Module check

Module check 

Source
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: Ada and Zoë 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-12 hex shape of a UUID.