SELECT `justfunctions.eu.replace_urls`("Google it https://www.google.com/ !", "")
/*--Output--
Google it !
*/
CREATE OR REPLACE FUNCTION `your_project_id.your_dataset_id.replace_urls`(`string` string, `replacement` string)
RETURNS string AS (REGEXP_REPLACE(string, r'((ftp|https?)\:\/\/)?[a-zA-Z0-9\.\/\?\:@\-_=#]+\.([a-zA-Z0-9\&\.\!\%\/\?\:@\-_=#])*', replacement))
OPTIONS ( description = '''Replaces URL patterns in a <string> with the specified <replacement>.''')
SQL User Defined Function (SQL UDF)
See something wrong? Contact us or report an issue on Github.