Snowflake-Labs / django-snowflake

MIT License
59 stars 15 forks source link

Switch to REGEXP_INSTR to avoid implicit anchoring #47

Closed fhoffa closed 1 year ago

fhoffa commented 1 year ago

The README says that "In Snowflake, the regex lookup pattern is implicitly anchored at both ends".

Switching to regexp_instr()>0 avoids this difference in behavior:

with data(s) as (select 'abcdefgh')

select s, s regexp '.*bcd.*', regexp_instr(s, 'bcd')>0
from data;