4.3K members online now
4.3K members online now
Ask questions about filter set-up and issues with using filters in Google Analytics reports
Guide Me

Regex Help - Segments

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭



This query has to do with segments rather than filters.


I am trying to isolate data for a group of pages using a segment and creating a Regex OR formula. I want the segment to contain a group of 50 pages. However, my Regex (shown below) only seems to return the first page.




Sorry to just paste the whole thing but thought it might help :-)


When I save this segment GA only returns data for the first page ie /b2b-sales-funnel-look-like-can-convert-leads-opportunities-faster


Does anybody know where I might be going wrong?


Many Thanks



Marked as Best Answer.
Accepted by topic author Anna G
June 2016

Re: Regex Help - Segments

Explorer ✭ ✭ ☆
# 2
Explorer ✭ ✭ ☆
The problem is that in every page that you include in your regex you use "^". For example:


To make it work remove "^" sign from everywhere except for the first expression and escape (use "\") every slash character in your expression. Using above example:


To make sure that your expression works as expected I would highly recommend using It's simple yet powerful.

Please let me know if it worked for you - I tried it the way I provided in the example and it seems that it matches all your pages.

Re: Regex Help - Segments

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Hi Andrzej

Thanks very much for providing a solution. It worked perfectly!

I understand where I went wrong with not escaping the forward slashes, but I thought a ^ means that this is the beginning of the url. So that is why I put them in.

Why does the ^ only go before the first uri and not the others?

Thanks again for your help :-)


Re: Regex Help - Segments

Explorer ✭ ✭ ☆
# 4
Explorer ✭ ✭ ☆
Glad I could help Smiley Happy.

As for your question - "^" literally means "there can't be any other character before me" Smiley Happy. So when you add second "^" in your regular expression then above rule is automatically violated and expression doesn't check anything after this point. It's because before second "^" you have some part of your regular expression. So expression will only work for the part before second "^".