Files
doris/docs/zh-CN/sql-reference/sql-functions/string-functions/regexp/not_regexp.md

1.5 KiB

title, language
title language
not regexp zh-CN

not regexp

description

syntax

BOOLEAN not regexp(VARCHAR str, VARCHAR pattern)

对字符串 str 进行正则匹配,匹配上的则返回 false,没匹配上则返回 true。pattern 为正则表达式。

example

// 查找 k1 字段中不以 'billie' 为开头的所有数据
mysql > select k1 from test where k1 not regexp '^billie';
+--------------------+
| k1                 |
+--------------------+
| Emmy eillish       |
+--------------------+

// 查找 k1 字段中不以 'ok' 为结尾的所有数据:
mysql > select k1 from test where k1 not regexp 'ok$';
+------------+
| k1         |
+------------+
| It's true  |
+------------+

keyword

REGEXP, NOT, NOT REGEXP