If you want extract a domain from provided URL strings in BigQuery.
It’s very easy. You can use net.Host
function.
1 2 3 4 5 6 7 8 9 10 11 |
WITH examples AS ( SELECT "https://some.domain.com/path?query=param#hash" AS example UNION ALL SELECT "some.domain.com/path?query=param#hash" AS example) SELECT NET.HOST(example) FROM examples |