Please prompt, how used REGEXP in SQLite?
Realization:
SELECT field FROM table WHERE field REGEXP '123'
It is not working. Error: no such function: REGEXP
Currently am working on sqlite3+php for my web application in Ubuntu 12.04. I was also faced the same issue then after research i had found that we need to install one pcre package for sqlite3. Here we go how to
apt-get install sqlite3-pcre
sqlite3 test.db
.load /usr/lib/sqlite3/pcre.so
SELECT url FROM table_name where url REGEXP '^google.*';
After following those 3 steps its working fine for me. If am wrong regarding this please correct me. I hope it will help you
Thanks
You can't use it.
First, you'd need a function that implements it, as per documentation:
The REGEXP operator is a special syntax for the regexp() user function. No regexp() user function is defined by default and so use of the REGEXP operator will normally result in an error message. If an application-defined SQL function named "regexp" is added at run-time, then the "X REGEXP Y" operator will be implemented as a call to "regexp(Y,X)".
There's no way to install user-defined functions in Android SQLite.
Consider whether you can write your regex as a GLOB
or LIKE
pattern instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With