From d4028bcd8c73f68d81a22bbfce24147373517832 Mon Sep 17 00:00:00 2001 From: Matt Garber Date: Fri, 9 Aug 2024 10:15:51 -0400 Subject: [PATCH] stricter ilike --- cumulus_library/template_sql/shared_macros/syntax.sql.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cumulus_library/template_sql/shared_macros/syntax.sql.jinja b/cumulus_library/template_sql/shared_macros/syntax.sql.jinja index 43d91639..b12e3fe9 100644 --- a/cumulus_library/template_sql/shared_macros/syntax.sql.jinja +++ b/cumulus_library/template_sql/shared_macros/syntax.sql.jinja @@ -64,7 +64,7 @@ REGEXP_LIKE({{ field }}, '^{{ wildcard_to_regex(match_string) }}$') {%- endmacro -%} {%- macro ilike(field, match_string) -%} -REGEXP_LIKE({{ field }}, '.*(?i:{{ wildcard_to_regex(match_string) }}).*$') +REGEXP_LIKE({{ field }}, '^(?i:{{ wildcard_to_regex(match_string) }})$') {%- endmacro -%} {#- Checks for NULL, empty, whitespace-only, and '\u0000' strings