【发布时间】:2017-11-28 16:33:10
【问题描述】:
我知道有很多关于惰性正则表达式匹配的问题,但我见过的解决方案都没有奏效。问题来了:
我的 BigQuery 结果中的一些地址如下所示:
www.example.comwww.example.com/path/to/page
apply.example.comapply.example.com/eapp/
我想去掉重复的部分得到
www.example.com/path/to/page
apply.example.com/eapp/
我试过像这样使用REGEX_REPLACE():
REGEXP_REPLACE(raw.query.tidy_Landing, r'(.*?)\.com','') AS Landing_Page
但这仍然会找到两个匹配项并返回
/path/to/page
/eapp/
我的正则表达式有什么问题?
【问题讨论】:
标签: regex google-bigquery