All Products
Search
Document Center

Realtime Compute for Apache Flink:REGEXP

Last Updated:Mar 26, 2026

Returns true if a string contains a match for the specified regular expression pattern, or false otherwise.

Limits

Supported only in Realtime Compute for Apache Flink that uses Ververica Runtime (VVR) 3.0.0 or later.

Syntax

BOOLEAN REGEXP(VARCHAR str, VARCHAR pattern)

Parameters

ParameterData typeDescription
strVARCHARThe string to search.
patternVARCHARThe regular expression pattern to match against.

Usage notes

  • If str or pattern is NULL, the function returns NULL.

  • If pattern is an invalid regular expression (for example, an unmatched parenthesis), the function returns false.

Example

Test data (table T1)

str1 (VARCHAR)pattern1 (VARCHAR)
k1=v1;k2=v2k2\*
k1:v1|k2:v2k3
NULLk3
k1:v1|k2:v2NULL
k1:v1|k2:v2(

Test statement

SELECT REGEXP(str1, pattern1) AS `result`
FROM T1;

Test result

result (BOOLEAN)
true
false
NULL
NULL
false

Rows 3 and 4 return NULL because one of the inputs is NULL. Row 5 returns false because ( is not a valid regular expression pattern.