Skip to main content

Module string

Module string 

Source

Functions§

fieldmask_covers
True when path is equal to candidate or is a sub-path of it (i.e. candidate is a prefix at a path-segment boundary).
is_address
address = hostname OR IP.
is_email
Email — permissive RFC 5321 addr-spec. protovalidate’s reference implementation allows leading/trailing and consecutive dots in the local part but rejects a trailing dot on the domain.
is_header_name
Well-known regex — HTTP header name.
is_header_value
Well-known regex — HTTP header value. strict=true delegates to http::HeaderValue::from_bytes (visible ASCII + tab); strict=false is looser (no CR/LF/NUL).
is_host_and_port
Hostname plus :port (0..=65535).
is_hostname
RFC 1035 hostname — labels of 1..=63 LDH characters, total ≤253 chars, and the final label must not be all digits.
is_ip
IPv4 OR IPv6.
is_ip_prefix
IPv4 or IPv6 canonical prefix.
is_ip_with_prefixlen
Either IPv4 or IPv6 with a prefix length.
is_ipv4
IPv4 in dotted-quad form.
is_ipv6
IPv6 — any valid RFC 4291 textual form. Also accepts RFC 6874 zone-id suffix %<zone> (any non-null characters).
is_ipv4_prefix
IPv4 canonical prefix — prefix length /N AND host bits zero.
is_ipv4_with_prefixlen
IPv4 with prefix length /N (0..=32).
is_ipv6_prefix
IPv6 canonical prefix — prefix length AND host bits zero.
is_ipv6_with_prefixlen
IPv6 with prefix length /N (0..=128).
is_protobuf_dot_fqn
Like is_protobuf_fqn but rejects leading/trailing dots and double dots.
is_protobuf_fqn
Protobuf FQN: dot-separated identifiers (no leading digit per segment).
is_tuuid
Trimmed UUID — same bytes without dashes (32 hex characters).
is_ulid
Canonical 26-char Crockford ULID.
is_uri
URI per RFC 3986 §3. Accepts absolute URIs (scheme required).
is_uri_ref
URI reference per RFC 3986 §4.1. Either a URI or a relative-ref.
is_uuid
Canonical hyphenated UUID per RFC 4122 §3 — 36-char 8-4-4-4-12 hex form.