regexp_substr
function
Applies to: Databricks SQL Databricks Runtime 11.3 LTS and above
Returns the first substring in str
that matches regexp
.
Returns
A STRING
.
The regexp
string must be a Java regular expression.
String literals are unescaped. For example, to match '\abc'
, a regular expression for regexp
can be '^\\abc$'
.
In case of a malformed regexp
the function returns an INVALID_PARAMETER_VALUE error.
If either argument is NULL
or the pattern is not found, the result is NULL
.