Declaration
REGEXP_LIKE(expr, pat[, match_type])
Description
If the string expr matches a value specified in the regular expression pat, 1 is returned; otherwise, 0 is returned. If either expr or pat is NULL, NULL is returned.
match_type can be set to the following values, which indicate the matching modes:
cindicates case sensitivity.iindicates case-insensitivity.mmatches line breaks in the string. By default, it only matches line breaks at the start and end of the string expression.nspecifies that the period.matches only line breaks (\n). By default,.matches any single character other than a line break (\n).umatches only the Unix line break. Only the line break character (\n) can be recognized as a line end by the characters.,^, 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