Skip to content
Advertisement

How do I extract the string after 0: in big query sql

I want to extract extract “f9sdsdsd-1375-41f7-8c4c-ereb20ad3843c” from “0:f9696a03-1375-41f7-8c4c-34b20ad3843c”.

I am currently using TRIM(REGEXP_EXTRACT(“0:f9696a03-1375-41f7-8c4c-34b20ad3843c”, r”0:[^:]+)”)) . However, I am not getting being able to extract it with the current syntax.

Can someone please help me here? Thanks.

Advertisement

Answer

you are just simply missing ( – use below

TRIM(REGEXP_EXTRACT("0:f9696a03-1375-41f7-8c4c-34b20ad3843c", r"0:([^:]+)"))
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement