[
https://issues.apache.org/jira/browse/FLINK-35931?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ASF GitHub Bot updated FLINK-35931:
-----------------------------------
Labels: pull-request-available (was: )
> Add REGEXP_EXTRACT_ALL function
> -------------------------------
>
> Key: FLINK-35931
> URL: https://issues.apache.org/jira/browse/FLINK-35931
> Project: Flink
> Issue Type: Sub-task
> Components: Table SQL / API
> Reporter: Dylan He
> Assignee: Dylan He
> Priority: Major
> Labels: pull-request-available
>
> Add REGEXP_EXTRACT_ALL function.
> ----
> Extracts all of the strings in {{str}} that match the {{regex}} expression
> and correspond to the regex group {{extractIndex}}.
> Example:
> {code:sql}
> > SELECT REGEXP_EXTRACT_ALL('100-200, 300-400', '(\\d+)-(\\d+)', 1);
> [100, 300]
> {code}
> Syntax:
> {code:sql}
> REGEXP_EXTRACT_ALL(str, regex[, extractIndex])
> {code}
> Arguments:
> * {{str}}: A STRING expression to be matched.
> * {{regex}}: A STRING expression with a matching pattern.
> * {{extractIndex}}: An optional INTEGER expression with default 0.
> Returns:
> An ARRAY<STRING>.
> {{regex}} must be a Java regular expression.
> {{regex}} may contain multiple groups. {{extractIndex}} indicates which regex
> group to extract and starts from 1. 0 means matching the entire regular
> expression, also the default value if not specified.
> 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_extract_all.html]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)