I am new to regex. I am trying to extract the website name from the long URL like below.
http://connect.themediatrust.com/d/?a=19481782541
I am trying to get everything before ".com" part.
SELECT
customer_id,
COALESCE(REGEXP_EXTRACT(referrer_uri, r'([^(.+?)".com"])'),referrer_uri) AS referrer_uri
FROM
[zz_marketing_analytics.visit_from_zumobi]
WHERE
referrer_uri="http://connect.themediatrust.com/d/?a=19481782541";
I am getting only "h" as refer URI. I'm not sure what's wrong.
REGEXP_EXTRACTused with Big Query.