regexp_like function (Databricks SQL)

Returns true if str matches regex.

Syntax

regexp_like( str, regex )

Arguments

  • str: A STRING expression to be matched.
  • regex: A STRING expression with a matching pattern.

Returns

A BOOLEAN.

The regex string must be a Java regular expression. String literals are unescaped. For example, to match '\abc', a regular expression for regex can be '^\\abc$'.

regexp_like is a function synonym for rlike operator (Databricks SQL).

Examples

> SELECT regexp_like('%SystemDrive%\\Users\\John', '%SystemDrive%\\\\Users.*');
true