NOT REGEXP

Overview

Negated Regular Expression matching.

USAGE

check NOT REGEXP match

Value Name

Description

check

A string expression to check.

match

A regular expression match string.

DETAILS

The NOT REGEXP operator works in a similar manner to the REGEXP operator but with the opposite return value. See that operator's description for how the regular expression matching works.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SELECT 'Hello there' NOT REGEXP 'the';
+--------------------------------+
| 'Hello there' NOT REGEXP 'the' |
+--------------------------------+
|                              0 |
+--------------------------------+
SELECT 'Hello there' NOT REGEXP '^e';
+-------------------------------+
| 'Hello there' NOT REGEXP '^e' |
+-------------------------------+
|                             1 |
+-------------------------------+
CREATE TABLE not_regexp_example (
  description VARCHAR(20),
  example INT
);
INSERT INTO not_regexp_example VALUES
  ('Everything', 42),
  ('Dalmations', 101),
  ('Agent', 99),
  ('B. Doz.', 13),
  ('CPU', 64);
SELECT *
FROM not_regexp_example
WHERE description NOT REGEXP 'ing$|^....t';
+-------------+---------+
| description | example |
+-------------+---------+
| Dalmations  |     101 |
| B. Doz.     |      13 |
| CPU         |      64 |
+-------------+---------+
-- Note that a backslash needs to be doubled due to string escaping
SELECT *
FROM not_regexp_example
WHERE description NOT REGEXP '\\.';
+-------------+---------+
| description | example |
+-------------+---------+
| Everything  |      42 |
| Dalmations  |     101 |
| Agent       |      99 |
| CPU         |      64 |
+-------------+---------+

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES