SELECT `justfunctions.eu.replace_html_tags`("<div class=\'test\'>hello world<a href=\'#\'>hello world<\a><\\div>", " ")
/*--Output--
hello world hello world
*/
CREATE OR REPLACE FUNCTION `your_project_id.your_dataset_id.replace_html_tags`(`string` string, `replacement` string)
RETURNS string AS (TRIM(REGEXP_REPLACE(string, r"<[^>]*>", replacement)))
OPTIONS ( description = '''Replaces HTML tags in a <string> with the specified <replacement>.''')
SQL User Defined Function (SQL UDF)
See something wrong? Contact us or report an issue on Github.