Syntax
REGEXP_LIKE(expr, pat[, match_type])
Purpose
Returns 1 if the string expr matches the value specified by the regular expression pat, otherwise returns 0. If expr or pat is NULL, returns NULL.
The match_type parameter specifies the matching mode and can have the following values:
cindicates case-sensitive matching.iindicates case-insensitive matching.mindicates that newline characters in the string are recognized. By default, only newline characters at the beginning and end of the string are matched.nindicates that the dot.matches only newline characters (\n). By default,.matches any single character except newline characters (\n).uindicates that only Unix-style line endings are matched. Only newline characters (\n) can be recognized as line endings by.and$.
Examples
obclient> SELECT REGEXP_LIKE('OceanBase', 'OCEANBASE');
+---------------------------------------+
| REGEXP_LIKE('OceanBase', 'OCEANBASE') |
+---------------------------------------+
| 1 |
+---------------------------------------+
1 row in set
obclient> SELECT REGEXP_LIKE('OceanBase', 'OCEANBASE','c');
+-------------------------------------------+
| REGEXP_LIKE('OceanBase', 'OCEANBASE','c') |
+-------------------------------------------+
| 0 |
+-------------------------------------------+
1 row in set
obclient> SELECT REGEXP_LIKE('Ocean\nBase', 'OCEAN.BASE');
+------------------------------------------+
| REGEXP_LIKE('Ocean\nBase', 'OCEAN.BASE') |
+------------------------------------------+
| 0 |
+------------------------------------------+
1 row in set
obclient> SELECT REGEXP_LIKE('Ocean\nBase', 'OCEAN.BASE','n');
+----------------------------------------------+
| REGEXP_LIKE('Ocean\nBase', 'OCEAN.BASE','n') |
+----------------------------------------------+
| 1 |
+----------------------------------------------+
1 row in set
