Files
doris/docs/zh-CN/sql-reference/sql-functions/string-functions/regexp/not_regexp.md
EmmyMiao87 15c5896f41 [Docs] Add like, regexp function documents (#6182)
* [Docs] Add like, regexp function documents

* Reconstruct

* Fix compile error
2021-07-15 13:16:21 +08:00

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