expr REGEXP pat, expr RLIKE pat : REGEXP : String Functions MySQL TUTORIALS


MySQL TUTORIALS » String Functions » REGEXP »

 

expr REGEXP pat, expr RLIKE pat


Returns 1 if expr matches pat; otherwise it returns 0.

If either expr or pat is NULL, the result is NULL.

REGEXP is not case sensitive, except when used with binary strings.

RLIKE is a synonym for REGEXP.

mysql>
mysql>
mysql> SELECT 'ABCDEF' REGEXP 'A%C%%';
+-------------------------+
'ABCDEF' REGEXP 'A%C%%' |
+-------------------------+
|                       |
+-------------------------+
row in set (0.00 sec)

mysql> SELECT 'ABCDE' REGEXP '.*';
+---------------------+
'ABCDE' REGEXP '.*' |
+---------------------+
|                   |
+---------------------+
row in set (0.00 sec)

mysql> SELECT 'new*n*line' REGEXP 'new\*.\*line';
+---------------------------------------+
'new*n*line' REGEXP 'new\*.\*line' |
+---------------------------------------+
|                                     |
+---------------------------------------+
row in set (0.00 sec)

mysql>



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo String Functions
» REGEXP