A curated list of regular expressions for Google Search Console, GA4, and Looker Studio.
Fundamental regex patterns that are useful across all platforms.
| Use Case | Regex Pattern | Description | Supported In |
|---|---|---|---|
| Match exact phrase | ^your-keyword$ |
Matches only "your-keyword" exactly. | GSC GA4 Looker |
| Match multiple phrases (OR) | keyword1|keyword2 |
Matches "keyword1" or "keyword2". | GSC GA4 Looker |
| Starts with... | ^start |
Matches anything starting with "start". | GSC GA4 Looker |
| Ends with... | end$ |
Matches anything ending in "end". | GSC GA4 Looker |
| Contains a word | .*word.* |
Matches any string that contains "word". GSC's "contains" filter doesn't need the `.*`. | GA4 Looker |
| Exclude a word | ^(?!.*exclude).* |
Negative lookahead: excludes strings containing "exclude". | GA4 Looker |
| Match URL paths | /blog/|/news/ |
Matches URLs containing either /blog/ or /news/. | GSC GA4 Looker |
| Match subdomain | ^https://(www|shop)\.example\.com |
Matches `www` or `shop` subdomains for `example.com`. | GSC GA4 Looker |
| Case-insensitive match | (?i)keyword |
Matches "keyword" in any case (e.g., Keyword, KEYWORD). GSC is case-insensitive by default. | GA4 Looker |
| Match numbers only | ^\d+$ |
Matches strings containing only digits (0-9). | GA4 Looker |
| Match non-digits | ^\D+$ |
Matches strings containing only non-numeric characters. | GA4 Looker |
| Match query parameters | \?.*= |
Matches any URL that contains a query parameter (e.g., `?utm_source=...`). | GSC GA4 Looker |