Welcome to WebmasterWorld Guest from 54.166.167.206

Forum Moderators: DixonJones & mademetop

Message Too Old, No Replies

RegEx for repetition of /

     
10:23 pm on Apr 26, 2013 (gmt 0)



I'm trying to figure out how i can do an advanced filter in GA on just urls that have one / (the first /), and no more. I don't want any subdirectories coming up.

I tried various things such as:

/{1}
/{0}

and others but nothing seems to work... any ideas?

thanks
1:42 am on Apr 27, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



If it boils down to a pure Regular Expression question I can help you figure it out. But I'd need more information because I'm sure there is some syntax that's specific to GA.

Viewed purely as a RegEx, the form
/{1}
would mean "one slash" -- with no information about what comes before or after. So there could be any number of slashes, either contiguous or scattered about.
Similarly, the form
/{0}
would mean, well, basically nothing.

If I were doing your search in raw logs, I would look for

^/[^/]+$

replacing the + with a * if I wanted to include requests for the front page (expressed as slash alone). The foregoing is not literally true, since each line of logs contains several categories of information. It's not just the request by itself. But the principle is there.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month