expect_column_values_to_match_like_pattern
Feb 24, 2026
·
5
min read
Values format
·
dbt-expectations
·
Column
How it Works
The expect_column_values_to_match_like_pattern test from the dbt-expectations package validates that all values in a column match a given SQL LIKE pattern. This is a simple but effective way to enforce string format conventions without needing full regex syntax.
Steps and Conditions
Column Selection: Identify the column to check.
Define Pattern: Provide the SQL LIKE pattern using
like_pattern.Optional Row Condition: Scope the check using
row_condition.Execution: Each value is compared against the LIKE pattern.
Outcome: Pass if all values match; fail if any do not.
Example Usage: Data Warehouse
An analytics team stores internal project codes that must always begin with a two-letter department prefix followed by a dash.
This ensures all project codes follow the expected naming convention, catching any codes that deviate from the standard format.





