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

Regex for page - segments

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Apologies that this doesn't come exactly under Filters but I couldn't see a more appropriate board.

 

I'm trying to create a segment for a group of pages. All of the pages I'd like to group together contain PCF in the URL, however some pages are PCF1718 and some are PCF 1617.

 

/Study/Course-Finder/PCF1718/ or /Study/Course-Finder/PCF1617/

 

Can anyone advise of any regex that can be used to segment on the PCF part of the URL?

 

Thanks

 

 

Regex for page - segments

Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭

Would the following do it?

 

\/PCF.*

 

If so, can anyone advise on how to seperate out the following URLs

 

/Study/Course-Finder/PCF1718/PTCF1718/ and /Study/Course-Finder/PCF1718/PRCF1718/ where they differ with PTCF and PRCF?

 

Thanks

 

 

Regex for page - segments

Participant ✭ ✭ ☆
# 3
Participant ✭ ✭ ☆

You can use:

/PCF[0-9]+/PTCF

for matching URLs like

/Study/Course-Finder/PCF1718/PTCF1718/

 

and

/PCF[0-9]+/PRCF

for matching URLs like 

/Study/Course-Finder/PCF1718/PRCF1718/

 

Term "[0-9]+" will match one or more digits in URL.

 

Regex for page - segments

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

Thanks Tomasz!