Comparison validators check values against expected content using various matching strategies.Documentation Index
Fetch the complete documentation index at: https://docs.timbal.ai/llms.txt
Use this file to discover all available pages before exploring further.
All string comparison validators support transforms and negation.
Equality
eq!
Checks for exact equality between the actual and expected values.| Parameter | Type | Description |
|---|---|---|
| value | any | The exact value to match |
Examples
Examples
ne!
Checks that the actual value does NOT equal the expected value. This is the negated form ofeq!.
| Parameter | Type | Description |
|---|---|---|
| value | any | The value that must NOT match |
Examples
Examples
String Matching
contains!
Checks if the actual value contains the expected substring or item.| Parameter | Type | Description |
|---|---|---|
| value | any | Substring or item to find |
Examples
Examples
not_contains!
Checks that the actual value does NOT contain the expected substring or item.| Parameter | Type | Description |
|---|---|---|
| value | any | Substring or item that must be absent |
Examples
Examples
contains_all!
Checks if the actual value contains ALL of the expected substrings or items.| Parameter | Type | Description |
|---|---|---|
| value | list | List of substrings/items that must ALL be present |
Examples
Examples
not_contains_all!
Checks that the actual value does NOT contain all of the specified items (at least one must be missing). This is the negated form ofcontains_all!.
| Parameter | Type | Description |
|---|---|---|
| value | list | List of items where at least one must be absent |
Examples
Examples
contains_any!
Checks if the actual value contains AT LEAST ONE of the expected substrings or items.| Parameter | Type | Description |
|---|---|---|
| value | list | List of substrings/items where at least one must be present |
Examples
Examples
not_contains_any!
Checks that the actual value contains NONE of the specified items. This is the negated form ofcontains_any!.
| Parameter | Type | Description |
|---|---|---|
| value | list | List of items that must ALL be absent |
Examples
Examples
pattern!
Checks if the actual value matches a regular expression pattern.| Parameter | Type | Description |
|---|---|---|
| value | string | Regular expression pattern |
Examples
Examples
Regular expressions use Python’s
re module syntax. Remember to escape special characters in YAML (use \\d instead of \d).not_pattern!
Checks that the actual value does NOT match the regular expression pattern. This is the negated form ofpattern!.
| Parameter | Type | Description |
|---|---|---|
| value | string | Regular expression pattern that must NOT match |
Examples
Examples
starts_with!
Checks if the actual value starts with the expected prefix.| Parameter | Type | Description |
|---|---|---|
| value | string | Expected prefix |
Examples
Examples
not_starts_with!
Checks that the actual value does NOT start with the expected prefix. This is the negated form ofstarts_with!.
| Parameter | Type | Description |
|---|---|---|
| value | string | Prefix that must NOT be present |
Examples
Examples
ends_with!
Checks if the actual value ends with the expected suffix.| Parameter | Type | Description |
|---|---|---|
| value | string | Expected suffix |
Examples
Examples
not_ends_with!
Checks that the actual value does NOT end with the expected suffix. This is the negated form ofends_with!.
| Parameter | Type | Description |
|---|---|---|
| value | string | Suffix that must NOT be present |
Examples
Examples
Numeric Comparisons
Numeric validators support integers, floats, and date strings.lt!
Checks if the actual value is less than the expected value.| Parameter | Type | Description |
|---|---|---|
| value | number or date string | Upper bound (exclusive) |
lte!
Checks if the actual value is less than or equal to the expected value.| Parameter | Type | Description |
|---|---|---|
| value | number or date string | Upper bound (inclusive) |
gt!
Checks if the actual value is greater than the expected value.| Parameter | Type | Description |
|---|---|---|
| value | number or date string | Lower bound (exclusive) |
gte!
Checks if the actual value is greater than or equal to the expected value.| Parameter | Type | Description |
|---|---|---|
| value | number or date string | Lower bound (inclusive) |
Numeric comparison examples
Numeric comparison examples