regexp
operator
Applies to: Databricks SQL Databricks Runtime 10.4 LTS and above
Returns true if str
matches regex
. This function is a synonym for rlike operator.
Syntax
str [NOT] regexp regex
Arguments
str
: ASTRING
expression to be matched.regex
: ASTRING
expression with a matching pattern.
Returns
A BOOLEAN
.
The regex
string must be a Java regular expression.
When using literals, use raw-literal
(r
prefix) to avoid escape character pre-processing.
str NOT regexp ...
is equivalent to NOT(str regexp ...)
.
Examples
> SELECT r'%SystemDrive%\Users\John' rlike r'%SystemDrive%\\Users.*';
true
> SELECT r'%SystemDrive%\Users\John' rlike r'%SystemDrive%\Users.*';
Error: INVALID_PARAMETER_VALUE.PATTERN
> SELECT r'%SystemDrive%\Users\John' rlike '%SystemDrive%\\\\Users.*';
true
Related functions
Feedback
https://aka.ms/ContentUserFeedback.
În curând: Pe parcursul anului 2024, vom elimina treptat Probleme legate de GitHub ca mecanism de feedback pentru conținut și îl vom înlocui cu un nou sistem de feedback. Pentru mai multe informații, consultați:Trimiteți și vizualizați feedback pentru