How to Check if a String Contains a Substring in BigQuery

Last updated July 26, 2026 · By the SaturnSQL team

LIKE with % wildcards handles simple substring checks. CONTAINS_SUBSTR is a faster, case-insensitive alternative, and REGEXP_CONTAINS covers pattern matching.

SELECT * FROM events WHERE url LIKE '%/pricing%';

CONTAINS_SUBSTR: simpler and case-insensitive

CONTAINS_SUBSTR normalizes case and can search across STRUCT fields, which makes it a good default for a 'does this row mention X' check.

SELECT * FROM events WHERE CONTAINS_SUBSTR(url, 'pricing');

Pattern matching with regex

SELECT * FROM events WHERE REGEXP_CONTAINS(url, r'/blog/[a-z0-9-]+$');

Run this in SaturnSQL

SaturnSQL is a browser-based SQL editor for teams: shared query library, schema-aware autocomplete, and scheduled exports to Google Sheets and Slack.

Try it free

Related BigQuery guides