0

I am using SQLite3 to track daily tests of my system , I logged all failure test ID lists/P4 Change List/Error info , etc in my SQLite3 DB below : enter image description here

Here is what I am trying to do with SQLite3 module in Python I want to use regular expression to search for any test parameter "combo" in "Failure Tests List" column. Let's say , I want to filter all failure tests contains "-algo5" and "-P2" If I use SQLite command :

"select * from Table where Failure_Test_List have "algo5" and Failure_Test_List have "-P2";"

it will treat Failure Tests List as a "WHOLE" rather than several different Test items.

So I am thinking of using Python "regex" module to handle it , is it possible ? Or any other SQLite embedded command / module I didn't realized ?

[Modified to point out difference between my problem and the "dup" question]

One more thing I'd like to point out is , the test items in "Failure Tests List" are actually combination of multiple tests, when dealing with them using REGEXP (at least this is the tool I think of for now, maybe there is another tool fit more) , sqlite command will treat them as a WHOLE any tools in sqlite can split them into separate tests items and use regex to filter each one of them , and then list out those matches ?

Jia
  • 2,417
  • 1
  • 15
  • 25
  • try checking this, https://stackoverflow.com/questions/5071601/how-do-i-use-regex-in-a-sqlite-query – Bara' Hashesh Aug 22 '18 at 15:21
  • I tried "REGEXP" with my sqlite3 , it reports error below: sqlite> SELECT suite FROM test where Failure REGEXP '*algo5*'; Error: no such function: REGEXP – Jia Aug 22 '18 at 15:32
  • If you want to use regular expressions, you have to use the [ICU](https://www3.sqlite.org/cgi/src/dir?ci=1e29fd430dead641&name=ext/icu) module or a third-party module that provides them. – Shawn Aug 22 '18 at 20:10
  • @Wiltor Stribizew – Jia Aug 23 '18 at 14:44

0 Answers0