nalgeon / sqlean

The ultimate set of SQLite extensions
MIT License
3.72k stars 118 forks source link

How to do case insensitive REGEXP matching? #100

Closed titanism closed 11 months ago

titanism commented 11 months ago

We didn't see a way at least in the docs to pass a flag, e.g. i for case insensitivity. Curious how this can be accomplished?

titanism commented 11 months ago

Looks like we can set it such as REGEXP '(?i)LINUS with (?i) in the regex itself, e.g. to match linus, Linus, LINUS, etc. Having a flag would be great too somehow (?)

nalgeon commented 11 months ago

Yep, (?i) is the way to go. I've updated the docs. No plans for a separate flag at this time.

titanism commented 11 months ago

@nalgeon awesome, thanks for adding to the docs for others! 🎉

P.S. if you want to see how we use it - see https://github.com/forwardemail/forwardemail.net/blob/8405a9ec5fcc38e2c6faff941c65eaca456e575c/helpers/imap/on-search.js#L271-L275 in our codebase for https://forwardemail.net (our email service running on SQLite 👍 )