I have some data in table e.g.:
id,params
123,utm_content=doit|utm_source=direct|
234,utm_content=polo|utm_source=AndroidNew|
desired data using regexp_extract:
id,channel,content
123,direct,doit
234,AndroidNew,polo
Query used:
Select id, REGEXP_extract(lower(params),'(.*utm_source=)([^\|]*)(\|*)',2) as channel, REGEXP_extract(lower(params),'(.*utm_content=)([^\|]*)(\|*)',2) as content from table;
It is showing error '* dangling meta character' and returning error code 2
Can someone help here please??
(.*utm_content=)([^|]*)(\\|*)
. I believe you are looking for([0-9]*),utm_content=([^|]*)\\|utm_source=([^|]*)