[ https://issues.apache.org/jira/browse/FLINK-35932?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
lincoln lee closed FLINK-35932. ------------------------------- Fix Version/s: 2.0.0 Resolution: Fixed Fixed in master: 8189bba195326d899a9830d3a19b50cafa092666 > Add REGEXP_COUNT function > ------------------------- > > Key: FLINK-35932 > URL: https://issues.apache.org/jira/browse/FLINK-35932 > Project: Flink > Issue Type: Sub-task > Components: Table SQL / API > Reporter: Dylan He > Assignee: Dylan He > Priority: Major > Labels: pull-request-available > Fix For: 2.0.0 > > > Add REGEXP_COUNT function. > ---- > Returns the number of times {{str}} matches the {{regex}} pattern. > Example: > {code:sql} > > SELECT REGEXP_COUNT('Steven Jones and Stephen Smith are the best players', > > 'Ste(v|ph)en'); > 2 > > SELECT REGEXP_COUNT('Mary had a little lamb', 'Ste(v|ph)en'); > 0 > {code} > Syntax: > {code:sql} > REGEXP_COUNT(str, regex) > {code} > Arguments: > * {{str}}: A STRING expression to be matched. > * {{regex}}: A STRING expression with a matching pattern. > Returns: > An INTEGER. > {{regex}} must be a Java regular expression. > If either argument is {{NULL}}, the result is {{NULL}}. > See also: > * > [Spark|https://spark.apache.org/docs/3.5.1/sql-ref-functions-builtin.html#string-functions] > * > [Databricks|https://docs.databricks.com/en/sql/language-manual/functions/regexp_count.html] > * [PostgreSQL|https://www.postgresql.org/docs/16/functions-string.html] -- This message was sent by Atlassian Jira (v8.20.10#820010)