Open titanism opened 10 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 (?)
Yeah, the (?i)
syntax is the current way to define flags, like:
select
value,
value regexp '(?i)linus' ,
value regexp 'linus'
from json_each('["linus", "Linus", "LINUS", "moo"]');
/*
┌───────┬──────────────────────────┬──────────────────────┐
│ value │ value regexp '(?i)linus' │ value regexp 'linus' │
├───────┼──────────────────────────┼──────────────────────┤
│ linus │ 1 │ 1 │
│ Linus │ 1 │ 0 │
│ LINUS │ 1 │ 0 │
│ moo │ 0 │ 0 │
└───────┴──────────────────────────┴──────────────────────┘
*/
The underlying Rust regex crate doesn't offer a way to define flags in any other way. I may also add a new regexpi()
function that'll implicitly add the ignore flag in the next reelase.
There's a comment here but it seems unrelated to the code https://github.com/asg017/sqlite-regex/blob/5fe28e3c7a978c621082cfef0ae6dea9a71167ee/src/regex.rs#L10-L11. Does this lib support flags? (e.g.
i
)