Skip to content

REGEXP_LIKE

Return t if the pattern matches at least one occurrence in the input.

Return f if there is no match.

Syntax

result = REGEXP_LIKE(input, pattern [, start [, reference]] [, flags])
input value

Specify the value against which the regular expression is matched.

pattern value

Specify the regular expression to be matched against the input.

The pattern value must be a constant string and cannot be a column reference.

start value

The position in the input from where the pattern match starts. The default start position is 1.

Yellowbrick does not support special meanings for negative start values.

The start values can be column references.

reference value

Specify which pattern match is of interest.

The reference values can be column references.

Note: The reference parameter for REGEXP_LIKE is supported by Yellowbrick but may not be supported by other databases.

flags value

Can be either i for case-insensitive matching or c for case-sensitive matching. Matching is case-sensitive by default.

The flags value must be a constant string and cannot be a column reference.

Return

If the pattern matches the input at least once, the function returns t.

If the pattern does not match the input, the function returns f.

Example

premdb=> select name from team where REGEXP_LIKE(name, '([a-z])\1\M');
    name     
--------------
 Cardiff City
 Hull City
(2 rows)

Parent topic:SQL Operators and Pattern Matching Functions