---
cuppy_hub: salesforce
cuppy_path: reference/official/data360/data-cloud-query-guide/references/dc-sql-reference/regexp-count.md
cuppy_section: docs
cuppy_doc: 8SN8-VAMJ
cuppy_doc_uuid: bcb8fab1-516b-4e99-8580-ba269e46e5a1
cuppy_permalink: https://cuppy.io/salesforce/d/8SN8-VAMJ
cuppy_version: 1
cuppy_updated: 2026-10-23T16:16:52.575Z
cuppy_canonical: https://cuppy.io/salesforce/docs/reference/official/data360/data-cloud-query-guide/references/dc-sql-reference/regexp-count
cuppy_mcp: https://cuppy.io/mcp
cuppy_body_sha256: a71b7e82bd2c6d69b0899490e34c33b634696ee344a16ceaadf82d656504ba76
# cuppy_body_sha256 is over the document body ALONE, excluding both generated blocks.
---

> Mirror of <https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/regexp-count.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_COUNT`

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

Returns the number of times a regular expression pattern occurs in a string.

*   `<string>`: The string to search within.
*   `<pattern>`: The regular expression pattern to count.

Returns an integer representing the number of times the pattern occurs.

*   Returns `0` when no matches are found.
*   Counts non-overlapping matches.
*   For detailed regex syntax, see [Regular Expression Syntax](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/string-matching.html#regular-expression-syntax).

Count individual digits in a string.

Returns `3`.

Count words in a string.

Returns `4`.

Returns `0` when pattern is not found.

Returns `0`.

Count occurrences of a specific pattern.

Returns `2`.

Check for expected number of matches.

Returns phone numbers with exactly 10 digits.

*   [REGEXP_SUBSTR](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/regexp-substr.html)
*   [REGEXP_INSTR](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/regexp-instr.html)
*   [Regular Expression Syntax](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/string-matching.html#regular-expression-syntax)

![Image 1: Salesforce](https://a.sfdcstatic.com/digital/one-trust/core/stable/consent/8e783e8c-0ad0-475d-8fca-4a03afa0a02a/019e3ba8-766d-7090-bf0d-c2f7beefa22d/logos/ddb906c9-f57b-40fc-85a1-c8bcbc371b0d/6a33a761-886e-4860-8e17-abc0832f7a62/corporate_logo_big.png)

## Cookie Consent Manager

## Cookie Consent Manager

*   ### General Information 
*   ### Required Cookies 
*   ### Functional Cookies 
*   ### Advertising Cookies 

#### General Information

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.   
[Privacy Statement](https://www.salesforce.com/company/privacy/full_privacy/)

#### Required Cookies

Always Active

Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.

Cookies Details

#### Functional Cookies

- [x] Functional Cookies 

Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.

Cookies Details

#### Advertising Cookies

- [x] Advertising Cookies 

Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.

Cookies Details

### Cookie List

Consent Leg.Interest

- [x] checkbox label label

- [x] checkbox label label

- [x] checkbox label label

Clear

*   - [x] checkbox label label 

Apply Cancel

Save Settings

Accept All Cookies

[![Image 2: Powered by Onetrust](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/regexp-count.html)](https://onetrust.com/poweredbyonetrust)


---
<!-- cuppy -->
You are reading one file. The same content is free over MCP at https://cuppy.io/mcp with no signup: ranked search across all 376 documents in this hub, the merged view when you work in a layer, known workarounds matched to the error you hit, and depth control so you spend tokens on what you need. Start with the `_hello` tool. How to connect: https://cuppy.io/salesforce/ Something wrong in this document? Report it with the `session feedback` tool on the same endpoint.
<!-- /cuppy -->
