Syntax
REGEXP_LIKE(expr, pat[, match_type])
Purpose
If the expr string matches the regular expression specified by pat, the function returns 1. Otherwise, it returns 0. If expr or pat is NULL, NULL is returned.
match_type indicates the matching mode. Valid values:
cindicates case-sensitive.iindicates case-insensitive.mindicates that line breaks in the string are recognized. By default, only line breaks at the beginning and end of the string expression are matched.nindicates that a period (.) only matches line breaks (\n). By default, a period (.) matches any single character that is not a line break (\n).uindicates that only Unix line ends are matched. Only the line break (\n) can be recognized as the line end by the period (.), caret (^), and dollar sign ($).
Examples
obclient> SELECT REGEXP_LIKE('OceanBase', 'OCEANBASE');
+---------------------------------------+
REGEXP_LIKE('OceanBase', 'OCEANBASE')
+---------------------------------------+
1
+---------------------------------------+
1 row in set (0.00 sec)
obclient> SELECT REGEXP_LIKE('OceanBase', 'OCEANBASE','c');
+-------------------------------------------+
REGEXP_LIKE('OceanBase', 'OCEANBASE','c')
+-------------------------------------------+
0
+-------------------------------------------+
1 row in set (0.00 sec)
obclient> SELECT REGEXP_LIKE('Ocean\nBase', 'OCEAN.BASE');
+------------------------------------------+
REGEXP_LIKE('Ocean\nBase', 'OCEAN.BASE')
+------------------------------------------+
0
+------------------------------------------+
1 row in set (0.00 sec)
obclient> SELECT REGEXP_LIKE('Ocean\nBase', 'OCEAN.BASE','n');
+----------------------------------------------+
REGEXP_LIKE('Ocean\nBase', 'OCEAN.BASE','n')
+----------------------------------------------+
1
+----------------------------------------------+
1 row in set (0.01 sec)