RLIKE

2023-10-24 09:23:03  Updated

Syntax

str RLIKE pat

Purpose

You can call this function to check 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 of 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 (0.00 sec)

Contact Us