fn regex_like(
pattern: &str,
case_insensitive: bool,
) -> Result<Regex, ArrowError>Expand description
Transforms a like pattern to a regex compatible pattern. To achieve that, it does:
- Replace
LIKEmulti-character wildcards%=>.*(unless they’re at the start or end of the pattern, where the regex is just truncated - e.g.%foo%=>foorather than^.*foo.*$) - Replace
LIKEsingle-character wildcards_=>. - Escape regex meta characters to match them and not be evaluated as regex special chars. e.g.
.=>\\. - Replace escaped
LIKEwildcards removing the escape characters to be able to match it as a regex. e.g.\\%=>%