Skip to content
Advertisement

snowflake string replace javascript udf

Trying to utilize Javascript’s String.prototype.replace() function in Snowflake, because apparently Snowflake’s regex_replace function lacks certain features such ast (forward/backward) look arounds.

Here is my Javascript UDF attempt:

JavaScript

However, when I try to execute using the example provided in the string.prototype.replace() documentation linked above. I’m not getting the expected result:

JavaScript

Any ideas?

Advertisement

Answer

because in Javascript the regex is not string lateral, it is it’s own thing.

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement