Google Analytics目标的正则表达式(需要查询字符串参数)

时间:2014-11-18 07:42:25

标签: regex google-analytics

我尝试构建一个前瞻性正则表达式来匹配一个网址,但前提是它同时包含action=upgraderesult=success作为查询字符串参数。

匹配的示例:

http://example.com/account/?result=success&action=upgrade#some_anchor

http://example.com/account/?action=upgrade&result=success#some_anchor

我在Rubular尝试了这个,但它没有用:

http://rubular.com/r/UmxQFkXm8z

1 个答案:

答案 0 :(得分:1)

试试这个:

^https(?=.*\bresult=success\b)(?=.*\baction=upgrade\b).*

进行测试你可以在这里试试:http://rubular.com/r/hXYcRL1lSw我只测试了你的例子。