Strip Queries from URLS in Google Data Studio with REGEXP_REPLACE

主宰稳场 提交于 2019-12-13 17:13:03

问题


I'm trying to build a new calculated field in Google Data Studio to get rid of all the queries. I've tried the following formula :

REGEXP_REPLACE(page,"\?(.*)","")

But Data Studio return me an invalid formula... I guess that's because It's not Google RE2... how do I translate this into Google RE2 ?

Thanks !


回答1:


You may use

REGEXP_REPLACE(page,"[?].*","")

The pattern will be parsed as a literal ? followed with any 0+ chars, and the whole match will get replaced with an empty string.



来源:https://stackoverflow.com/questions/45934988/strip-queries-from-urls-in-google-data-studio-with-regexp-replace

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!