VeloDB Cloud
SQL Manual
Functions
string-functions
regexp
not regexp

not regexp

Description

Syntax:

BOOLEAN not regexp(VARCHAR str, VARCHAR pattern)

This function performs regular matching on the string str. If the string matches the condition, it will return false; if it doesn't, it will return true. pattern is a regular expression.

Example

// Find all data in the k1 field that does not start with 'billie'
mysql> select k1 from test where k1 not regexp '^billie';
+--------------------+
| k1                 |
+--------------------+
| Emmy eillish       |
+--------------------+

// Find all the data in the k1 field that does not end with 'ok':
mysql> select k1 from test where k1 not regexp 'ok$';
+------------+
| k1         |
+------------+
| It's true  |
+------------+

Keywords

REGEXP, NOT, NOT REGEXP