Strings
Validation for text data.
Strings
The string validator handles UTF-8 text and provides rich format checks.
string().min(3).email()rod.string().min(3).email()rod.string().min(3).email()Length Constraints
Rod counts Unicode characters, not bytes.
.min(n): Minimum characters..max(n): Maximum characters..length(n): Exact character count.
Format Validation
.email(): Validates email format..url(): Validates URL format (http/https)..uuid(): Validates UUID v4..datetime(): Validates ISO 8601 strings..ip(): Validates IPv4 or IPv6.
Content Matching
string()
.starts_with("prefix")
.ends_with("suffix")
.includes("middle")
.regex(r"^[a-z]+$")
.trim()rod.string()
.startsWith("prefix")
.endsWith("suffix")
.includes("middle")
.regex("^[a-z]+$")
.trim()rod.string()
.starts_with("prefix")
.ends_with("suffix")
.includes("middle")
.regex("^[a-z]+$")
.trim()Regex patterns are currently compiled on-the-fly inside the validation engine. For high-performance hot paths, prefer specific helpers like .startsWith() or .includes().