word_tokens(string, symbol)
Splits a <string> into words using the specified <symbol>.
CREATE OR REPLACE FUNCTION `justfunctions.eu.word_tokens`(`string` string, `symbol` string)
RETURNS ARRAY<STRING> AS (SPLIT(REGEXP_REPLACE(LOWER(string),symbol," "), " "))
OPTIONS ( description = '''Splits a <string> into words using the specified <symbol>.''')
Example
SELECT `justfunctions.eu.word_tokens`("this is a sentence", "\\s+")
['this', 'is', 'a', 'sentence']