not regexp

description

syntax

BOOLEAN not regexp(VARCHAR str, VARCHAR pattern)

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

example

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

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

keywords

1. REGEXP, NOT, NOT REGEXP