Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Applies to:
Databricks SQL
Databricks Runtime
Extracts all of the strings in str that match the regexp expression and correspond to the regex group index.
Syntax
regexp_extract_all(str, regexp [, idx] )
Arguments
str: ASTRINGexpression to be matched.regexp: ASTRINGexpression with a matching pattern.idx: An optional integral number expression greater or equal 0 with default 1.
Returns
An ARRAY<STRING>.
The regexp string must be a Java regular expression.
When using literals, use raw-literal (r prefix) to avoid escape character pre-processing.
regexp may contain multiple groups.
idx indicates which regex group to extract.
An idx of 0 means match the entire regular expression.
Examples
> SELECT regexp_extract_all('100-200, 300-400', '(\\d+)-(\\d+)', 1);
[100, 300]