SQLite Forum

Broken logical NOT in ext/misc/regexp.c
Login
I have found that logical not operations like `[^something]`, `\W`, `\D` don't work when used alone (without modifiers like `+` `$`  `^`, except {}).

> select 'abc' regexp '\\W' ---> 1

> select '123' regexp '\\D' ---> 1

> select 'abc' regexp '[^a-z]' ---> 1

> select 'abc' regexp '\\W{1,1}' --> 1

> select 'abc' regexp '\\W{1}' --> 1


but

> select 'abc' regexp '\\W+' ---> 0

> select '123' regexp '^\\D' ---> 0

> select 'abc' regexp '[^a-z]$' ---> 0

> select 'abc' regexp '\\W{2}' --> 0


I suspect that something is wrong with the end-of-text event handling...