Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在SQLite中实现regexp否定?_Regex_Sqlite - Fatal编程技术网

如何在SQLite中实现regexp否定?

如何在SQLite中实现regexp否定?,regex,sqlite,Regex,Sqlite,我希望使用SQLite实现正则表达式的否定,并使用postgresql作为参考。这能做到吗 例如,如果我想执行此声明: case when keyword !~ '.*Brand*' then 'non brand user' end 我试过,但没有成功: case when keyword !REGEXP '.*Brand*' then 'non brand user' end 这是一个简化的例子。我知道“like”操作符,与regexp相比,使用它需要执行大量的工作。SQLite没有任何

我希望使用SQLite实现正则表达式的否定,并使用postgresql作为参考。这能做到吗

例如,如果我想执行此声明:

case when keyword !~ '.*Brand*' then 'non brand user' end
我试过,但没有成功:

case when keyword !REGEXP '.*Brand*' then 'non brand user' end

这是一个简化的例子。我知道“like”操作符,与regexp相比,使用它需要执行大量的工作。

SQLite没有任何内置的regex支持,尽管可能包含它。但是,我认为,
不像
可能已经做了您需要的事情:

SELECT
    CASE WHEN keyword NOT LIKE '%Brand%' THEN 'non brand user' END AS status
FROM yourTable

SQLite没有任何内置的正则表达式支持,尽管可能包含它。但是,我认为,
不像
可能已经做了您需要的事情:

SELECT
    CASE WHEN keyword NOT LIKE '%Brand%' THEN 'non brand user' END AS status
FROM yourTable

我发现它可以用NOT REGEXP来完成我发现它可以用NOT REGEXP来完成