expect_column_values_to_match_regex
Feb 24, 2026
·
5
min read
Values format
·
dbt-expectations
·
Column
How it Works
The expect_column_values_to_match_regex test from the dbt-expectations package validates that every value in a column matches a specified regular expression. This is a powerful format validation tool for fields with strict structural requirements, such as email addresses, phone numbers, postal codes, or ISO date formats.
An optional row_condition can scope the check to specific rows.
Steps and Conditions
Column Selection: Identify the column to validate.
Define Pattern: Provide the regex pattern using
regex.Optional Row Condition: Filter rows using
row_condition.Execution: Each value is tested against the pattern.
Outcome: Pass if all values match; fail if any do not.
Example Usage: Email Validation
A customer platform stores email addresses and wants to ensure they always match a standard email format.
Malformed email addresses that would cause delivery failures are caught before they reach the marketing automation system.





