问题
Is it possible to rebuild libsqlite3.dylib with the regexp function added? Or use create_sqlite_function to do it?
回答1:
As the SQLite documentation says:
If a application-defined SQL function named "regexp" is added at run-time, that function will be called in order to implement the REGEXP operator.
so you should be able to use create_sqlite_function
like you already suggested yourself.
回答2:
create a regex function and then create sqlite function in your run time and pass the address of regex function and db instance in create sqlite function and enjoy querying regex in runtime to sqlite. I have also done that it works fine
来源:https://stackoverflow.com/questions/9312994/no-such-function-regexp-in-sqlite3-on-ios