extract_email_domain_base(url)
Extracts the base domain from an <email>.
CREATE OR REPLACE FUNCTION `justfunctions.eu.extract_email_domain_base`(`url` STRING)
RETURNS STRING AS (REPLACE (NET.REG_DOMAIN(url), CONCAT('.',NET.PUBLIC_SUFFIX(url)),""))
OPTIONS ( description = '''Extracts the base domain from an <email>.''')
Example
SELECT `justfunctions.eu.extract_email_domain_base`("jason@justdataplease.com")
justdataplease