SELECT `justfunctions.eu.extract_url_prefix`("https://en.hey.com/me/?231#213")
/*--Output--
en
*/
CREATE OR REPLACE FUNCTION `your_project_id.your_dataset_id.extract_url_prefix`(`url` STRING)
RETURNS STRING AS (SPLIT(url,".")[OFFSET(0)])
OPTIONS ( description = '''Extracts the URL prefix from a <url>.''')
SQL User Defined Function (SQL UDF)
See something wrong? Contact us or report an issue on Github.