[sqlite] maybe bug in regexp and replace with newlines?

2015-12-18 Thread michael
>/> The statement: />/> select distinct text from v_term_item where replace(lower(text),0x0A,'') REGEXP('.*/some_text/.*'); />/> doesn't work like that: / > Try x'0A' instead (that's a BLOB literal, and should be converted to a > string). 0x0A is an integer, I suspect it gets converted to the

[sqlite] maybe bug in regexp and replace with newlines?

2015-12-11 Thread Igor Tandetnik
On 12/10/2015 9:01 AM, michael wrote: > The statement: > select distinct text from v_term_item where replace(lower(text),0x0A,'') > REGEXP('.*/some_text/.*'); > doesn't work like that: Try x'0A' instead (that's a BLOB literal, and should be converted to a string). 0x0A is an integer, I suspect

[sqlite] maybe bug in regexp and replace with newlines?

2015-12-10 Thread michael
On 12/2/2015 7:54 AM, michael wrote: >>/sqlite3 -header flexsql.db "select distinct replace(lower(text),0x0A,'') >>/>>/from v_term_item where lower(text) REGEXP('.*some_text.*') limit 1;" / >You are removing newlines in the wrong spot. Do it on the left-hand side >of REGEXP, not in SELECT

[sqlite] maybe bug in regexp and replace with newlines?

2015-12-02 Thread michael
>> sqlite3 -header flexsql.db "select distinct text from v_term_item where >> name='text' and lower(text) REGEXP('.*some_text.*');" >> which doesn't works >REGEXP is not compiled into SQLite by default. >Simon. Yes but in gentoo it is compiled. Only a problem with new lines

[sqlite] maybe bug in regexp and replace with newlines?

2015-12-02 Thread michael
I tried sqlite3 -header flexsql.db "select distinct text from v_term_item where name='text' and lower(text) REGEXP('.*some_text.*');" which doesn't works sqlite3 -header flexsql.db "select distinct text from v_term_item where name='text' and lower(text) like '%some_text%';" works so I tried a

[sqlite] maybe bug in regexp and replace with newlines?

2015-12-02 Thread Simon Slavin
On 2 Dec 2015, at 12:54pm, michael wrote: > sqlite3 -header flexsql.db "select distinct text from v_term_item where > name='text' and lower(text) REGEXP('.*some_text.*');" > which doesn't works REGEXP is not compiled into SQLite by default. Simon.

[sqlite] maybe bug in regexp and replace with newlines?

2015-12-02 Thread Igor Tandetnik
On 12/2/2015 7:54 AM, michael wrote: > sqlite3 -header flexsql.db "select distinct replace(lower(text),0x0A,'') > from v_term_item where lower(text) REGEXP('.*some_text.*') limit 1;" You are removing newlines in the wrong spot. Do it on the left-hand side of REGEXP, not in SELECT clause. The