0

My Android dictionary project use Arabic language for doing search view between search list. run project was successful with using regex. but using of SQLCipher for encrypt caused error. when typed Arabic character in search view:

net.sqlcipher.database.SQLiteException: no such function: REGEXP: while compiling: Select * From tblWord Where word_arabic REGEXP ‘^ل[ًٌٍَُِّْ]{0,}.*’

Now, Please tell me the way to use alternative for REGEXP.

5
  • in given example there is no need to use regexp and it can be replaced with LIKE. does it work for you? Commented Oct 2, 2018 at 11:37
  • cursor=mDatabase.rawQuery("Select * From tblWord Where " + language + " LIKE '_َ %' OR " + language + " LIKE '_ً %' OR " + language + " LIKE '_ُ %' OR " + language + " LIKE '_ٌ %' OR " + language + " LIKE '_ِ %' OR " + language + " LIKE '_ٍ %' ", args); /// // i did with this command and had this error : net.sqlcipher.database.SQLiteException: column index out of range: handle 0x52f75190 Commented Oct 2, 2018 at 15:29
  • I see. how about where substr(language, 1, 1) in ("ل", "[", "َ", "ً", "ُ", "ٌ", "ِ", "ٍ", "ّ", "ْ", "]", "{", "0")? Commented Oct 2, 2018 at 15:44
  • as for 'column index out of range' it maybe if you specify something in args - since your SQL query has no placeholders to inject variables to. Commented Oct 2, 2018 at 15:46
  • Thanks @skyboy. but that Is not resolved . Commented Oct 2, 2018 at 16:21

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.