I'm trying to create content groups in Google Analytics. How do I match a page with sport/[SOMETHING] and not sport/[SOMETHING]/[SOMETHING]
Match:
Do not Match:
答案 0 :(得分:5)
We can say "not the following characters" using [^...]
the ^
stands for "not". So to restrict the levels we can use [^/]
.
Here some examples:
Match /sport/something : ^/sport/[^/]+$
Has to start with / and then exactly 1 / has to follow: ^/[^/]+/[^/]+$
or ^(/[^/]+){2}$
Generalized for start with / and followed by 4 / at most: ^(/[^/]+){1,5}$
答案 1 :(得分:1)
这对我有用Just "someguy"
说明: ^ / sports / =>类别,以匹配/使用\
转义([[^ /] +)=>不是/一次或多次
/ $ =>结束的第一级页面深度/带有$止损