select
'This (is) a-Test' as subject,
'This (is) a-' as pattern,
regexp_replace(subject,pattern,'',1,1);
In the above example, I am trying to replace the first occurrence of the pattern from the subject. I just want to extract Test
from subject but I am getting This (is) a-Test
. I cannot use escape characters ('This \(is\) a-Test')
because in the real application both subject and pattern are coming from two columns.
My question is how to ignore brackets when using regexp_replace
to replace string in snowflake?