replace_urls(string, replacement)
Replaces URL patterns in a <string> with the specified <replacement>.
CREATE OR REPLACE FUNCTION `justfunctions.eu.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>.''')
Example
SELECT `justfunctions.eu.replace_urls`("Google it https://www.google.com/ !", "")
Google it !