繁体   English   中英

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

[英]BigQuery regex remove/replace a list of text from a string

我将如何 go 关于删除字符串中的文本列表? 基本上有一个 URL 列,并希望避免非常长的正则表达式和多个嵌套替换函数。

有没有办法声明一个文本列表,例如“http”、“www.”等,并将它们从 go 的列中删除?

您可以使用以下简单方法

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     

与 output

在此处输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM