RLIKE

2023-10-31 11:17:12  Updated

Syntax

str RLIKE pat

Purpose

RLIKE() checks whether a string matches a regular expression. If the str string matches the specified regular expression, 1 is returned. Otherwise, 0 is returned. If str or pat is NULL, the return value is NULL.

This function is a synonym for the REGEXP() function.

Examples

obclient> SELECT 'hello world!' RLIKE '^hello','hello world!' RLIKE '^hello$';
+-------------------------------+--------------------------------+
| 'hello world!' RLIKE '^hello' | 'hello world!' RLIKE '^hello$' |
+-------------------------------+--------------------------------+
|                             1 |                              0 |
+-------------------------------+--------------------------------+
1 row in set

Contact Us