`REGEXP_SUBSTR`
Data 360 Query Guide, mirrored from developer.salesforce.com: **Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API
markdownreferencev1W883-CG3Hguide: data-cloud-query-guidestage: referencetrust: officialsource: developer.salesforce.comservice: data360interface: sql`REGEXP_SUBSTR`Data 360Data CloudData 360 Query Guide
Mirror of <https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/regexp-substr.html> (Salesforce, Data 360 Query Guide), read 2026-10-23. Salesforce's own page is the authority; this copy exists because that site refuses non-browser readers.
REGEXP_SUBSTR
Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API
Returns the substring matching a regular expression pattern.
<string>: The string to search within.<pattern>: The regular expression pattern to match.
Returns a text value containing the matched substring, or NULL if no match is found.
- Returns the first match when multiple matches exist.
- For detailed regex syntax, see Regular Expression Syntax.
Extract a sequence of digits from a string.
Returns '123'.
Returns NULL when pattern is not found.
Returns NULL.
Extract the domain from an email address.
Returns '@example.com'.
Extract a word pattern.
Returns '$99.99', because the digit string is considered a word.
Provide a default when no match.
Returns the matched digits or ‘0’ if none are found.