How to run a query with regexp in Android

前端 未结 2 1712
心在旅途
心在旅途 2020-12-11 19:31

I want to run a query in SQLite with a regexp using Android. How do I do that?

2条回答
  •  萌比男神i
    2020-12-11 19:59

    Unfortunately it doesn't look like Android currently supplies a way for you to inject a user function into sqlite, which is what you'd need to make REGEXP work (specifically, you'd need a user function named regexp()) -- so you may have to select more broadly (with a LIKE condition that's broader than the regexp you want) and further distinguish "actual" result (those that really match the regexp you want) with java.util.regex in your application.

提交回复
热议问题