I can’t get case insensitive searches to work for REGEX in SQLITE. Is the syntax supported?
SELECT * FROM table WHERE name REGEXP 'smith[s]*\i'
I would expect the following answers (assuming the database has these entries):
Smith
Smiths
smith
smitH <— Not a typo but in database
Note – This is a small part of a larger REGEX, so I won’t be using LIKE
The
REGEXPfunction shipped with SQLite Manager is implented in JavaScript as follows:To get case-insensitive searches with the JavaScript RegExp object, you would not add a flag to the pattern string itself, but pass the
iflag in the second parameter to theRegExpconstructor. However, the binaryREGEXPoperator does not have a third flags parameter, and the code does not try to extract flags from the pattern, so these flags are not supported in this implementation.