REGEXP_COUNT
functionsupportedCore SQL functionsReturns the number of times that a pattern occurs in a string.
Syntax
supportedpartialnot supportednot scored
REGEXP_COUNT( <subject> ,
<pattern>
[ , <position>
[ , <parameters> ]
]
)
Parameters
| Name | Required | Description |
|---|---|---|
subject | required | The string to search for matches. |
pattern | required | Pattern to match. For guidelines on specifying patterns, see String functions (regular expressions). |
position | optional | Number of characters from the beginning of the string where the function starts searching for matches. The value must be a positive integer. Default: 1 (the search for a match starts at the first character on the left) |
Returns
Returns a value of type NUMBER. Returns NULL if any argument is NULL.
Usage notes
- See the General usage notes for regular expression functions.
Collation details
When the 2026_04 BCR bundle is enabled, the function accepts arguments with a collation specification. The collation has no effect on pattern matching: matching is always case-sensitive unless you pass the i flag in the parameters argument.