Returns TRUE if the value matches the regular expression. Useful for pattern matching and format validation.
BOOLDiperbarui: 13 Jun 2026REGEXP_CONTAINS(value, regexp)The string to test
Regular expression pattern (re2 syntax)
1 SELECT 2 email, 3 REGEXP_CONTAINS(email, r'@gmail\.com$') as is_gmail 4 FROM `project.dataset.users`;
Check whether an email belongs to Gmail.
| is_gmail | |
|---|---|
| john@gmail.com | true |
| jane@yahoo.com | false |
1 SELECT 2 phone, 3 REGEXP_CONTAINS(phone, r'^\+62[0-9]{9,12}$') as valid_indo 4 FROM `project.dataset.contacts`;
Validate Indonesian phone number format.
| phone | valid_indo |
|---|---|
| +6281234567890 | true |
| 081234567890 | false |
1 SELECT * 2 FROM `project.dataset.products` 3 WHERE REGEXP_CONTAINS(sku, r'^[A-Z]{2}-[0-9]{4}$');
Filter products with a specific SKU format.
Sudah paham REGEXP_CONTAINS? Latih langsung di browser
Latihan interaktif, langsung di browser.