How do I extract a certain value between two substrings in redshift with regex?
I have strings like the one below in a column in redshift:
[{'code': 'bla', 'amount': '149.30', 'type': 'fixed_amount'}]
I want to extract the float number. I used several regex expressions, but seems like redshift is not accepting them.
select order_id, discount_codes, regexp_substring(discount_codes, '''amount'': ''[^'']*') as value from orders_shopify_de
Gave me this error:
ERROR: function regexp_substring(character varying, "unknown") does not exist Hint
Also for example:
regexp_replace(discount_codes, '(?<=''amount'': '')(.*)(?='',)')
Gave me this error:
ERROR: function regexp_substring(character varying, "unknown") does not exist Hint
Is there a way to extract the float?
Thanks in advance!