नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
Applies to:
Databricks SQL
Databricks Runtime
Replaces all substrings of str that match regexp with rep.
Syntax
regexp_replace(str, regexp, rep [, position] )
Arguments
str: ASTRINGexpression to be matched.regexp: ASTRINGexpression with a matching pattern.rep: ASTRINGexpression which is the replacement string.position: A optional integral numeric literal greater than 0, stating where to start matching. The default is 1.
Returns
A STRING.
The regexp string must be a Java regular expression.
When using literals, use raw-literal (r prefix) to avoid escape character pre-processing.
Searching starts at position. The default is 1, which marks the beginning of str.
If position exceeds the character length of str, the result is str.
Examples
> SELECT regexp_replace('100-200', '(\\d+)', 'num');
num-num