Skip to main content

String values

Validations to check the format and length of string values in a column.


Strings length must be in range

Every value in the column must be a string with a length between the specified minimum and maximum. This validation is inclusive by default.

Use this when you want to enforce length constraints on a text column — for example, ensuring a country_code column always has between 2 and 3 characters, or that a description field is never empty or excessively long.

Parameters

NameTypeRequiredDescription
ColumnColumnThe column to validate.
Minimum valueNumberThe minimum allowed string length.
Maximum valueNumberThe maximum allowed string length.

Example

user_idusername
1al
2maria
3this_username_is_way_too_long_for_our_system
Example 1Example 2
Columnusernameusername
Minimum value32
Maximum value2050
Result❌ Fails✅ Passes
ReasonRow 1 has al (length 2), below the minimum of 3. Row 3 has a value exceeding the maximum of 20All values have a length within [2, 50]

Strings length must be equal to

Every value in the column must be a string with exactly the specified length.

Use this when you need to enforce a fixed-length format — for example, a country_code column that must always be exactly 2 characters, or a product_sku that follows a fixed-length convention.

Parameters

NameTypeRequiredDescription
ColumnColumnThe column to validate.
ValueNumberThe exact required string length.

Example

transaction_idcountry_codecurrency
1ARARS
2USAUSD
3BRBRL
Example 1Example 2
Columncountry_codecurrency
Value23
Result❌ Fails✅ Passes
ReasonRow 2 has USA (length 3), which is not equal to 2All values in currency have exactly length 3

Column value must match regex expression

Every value in the column must match the specified regular expression.

Use this when you want to enforce a format pattern — for example, ensuring an email column always contains a valid email address, or that a phone column follows a specific format.

Parameters

NameTypeRequiredDescription
ColumnColumnThe column to validate.
RegexStringA regular expression that all values must match. For example: ^[A-Z]{2}$

Example

user_idemail
1alice@example.com
2not-an-email
3bob@company.org
Example 1Example 2
Columnemailemail
Regex^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$^.+$
Result❌ Fails✅ Passes
ReasonRow 2 has not-an-email, which does not match the email patternAll values match the pattern — at least one character