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:
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}$
This worked for me ^\\/sports\\/([^\\/]+)\\/$
Explanation: ^/sports/ => category to match with / escaped using \\
([^/]+) => the not / once or more
/$ => the closing first level page depth / with a $ stop
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.