Sql BigQuery正则表达式从字符串中删除/替换文本列表

Sql BigQuery正则表达式从字符串中删除/替换文本列表,sql,regex,google-bigquery,Sql,Regex,Google Bigquery,如何删除字符串中的文本列表? 实际上,它有一个URL列,希望避免过长的regexp和多个嵌套的replace函数 有没有一种方法可以声明一个文本列表,如“http”、“www.”等,并一次性将其从列中删除?您可以使用下面的简单方法 with t as ( select 'Is there a way to declare a list of text such as "http", "www.", etc and have them removed f

如何删除字符串中的文本列表? 实际上,它有一个URL列,希望避免过长的regexp和多个嵌套的replace函数


有没有一种方法可以声明一个文本列表,如“http”、“www.”等,并一次性将其从列中删除?

您可以使用下面的简单方法

with t as (
  select 'Is there a way to declare a list of text such as "http", "www.", etc and have them removed from the column in one go?' col
)
select regexp_replace(col, r'http|www.|etc', '') cleaned_col
from t     
有输出


您可以使用以下简单方法

with t as (
  select 'Is there a way to declare a list of text such as "http", "www.", etc and have them removed from the column in one go?' col
)
select regexp_replace(col, r'http|www.|etc', '') cleaned_col
from t     
有输出


请提供样本数据和预期结果。请提供样本数据和预期结果。