Skip to main content
Version: V1.0.0

RLIKE

Declaration

str RLIKE pat

Description

Determines whether a string matches a regular expression. If the string str matches the specified regular expression, it returns 1; otherwise, it returns 0. If either str or pat is NULL, the result is NULL.

This function is a synonym for REGEXP().

Examples

SELECT 'hello world!' RLIKE '^hello','hello world!' RLIKE '^hello$';
+-------------------------------+--------------------------------+
| 'hello world!' RLIKE '^hello' | 'hello world!' RLIKE '^hello$' |
+-------------------------------+--------------------------------+
| 1 | 0 |
+-------------------------------+--------------------------------+
1 row in set (0.001 sec)