how to search sqlite database using regular expression in android?

前端 未结 2 851
既然无缘
既然无缘 2020-12-21 09:49

I am trying to search a database using regular expression in sqlite. Here is my code:

cursor = db.rawQuery(\"SELECT _id, employee FROM employees WHERE employ         


        
相关标签:
2条回答
  • 2020-12-21 10:08

    As James suggested, use the LIKE operator, and then do a java search on the results using regular expressions

    0 讨论(0)
  • 2020-12-21 10:19

    In sqllite the "REGEXP" function is not included by default and you need to "roll your own".

    However the "LIKE" operator should do what you want as long as your searches are reasonably simple.

    the docs

    0 讨论(0)
提交回复
热议问题