Rich-text Reply

Targeting with substrings / regex

rutger 06-19-14
Accepted Solution

Targeting with substrings / regex

Hi,

 

I am the founder to a site which generates leads for scuba dive operators. 

I am now using optimizly to test call to actions on specific detail pages where scuba dive packages are published. 

 

1 operator can have multiple detail pages with different packages published. The structure of these pages is side wide the same. The URL structure for these package pages is: mysite.com/name_of_operator/packages/name_of_package

 

Now I have set up a test on 1 page and would like to match it to  similair pages too. 

It seems that subtrings will not work for this situation and I do not have any knowledge of regex.

 

Does anyboddy have a suggetion how I could make this work?

 

 

Level 2

MeganBush 06-19-14
 

Re: Targeting with substrings / regex

Hello!
If all of the pages you want to target have /packages/ in the URL (and only those pages have /packages/ in the URL), you can set up the targeting conditions through a regular expression with just /packages/.
See a screenshot here: http://screencast.com/t/OmokwJca

You can also test URLs using the URL match validator link under the conditions!
Megan Bush
adzeds 06-20-14
 

Re: Targeting with substrings / regex

Yeah, @MeganBush has proved a solution that should work for you.
David Shaw
Level 11
rutger 06-20-14
 

Re: Targeting with substrings / regex

Thank you @MeganBush much appriciated!

Level 2
rutger 06-20-14
 

Re: Targeting with substrings / regex

Yes, thanks! Smiley Happy
Level 2
xgrioux 11-29-16
 

Re: Targeting with substrings / regex

How would I use Regular Expression if only the middle part of the url is unique? For example I have this url: https://www.investability.com/exclusive/15667643/details
I would like to target all of the variations of the number 15667643... I was hoping for a solution that would allow me to write something like this: https://www.investability.com/exclusive/{ ? }/details
Level 2
CouchPsycho 11-30-16
 

Re: Targeting with substrings / regex

Hi,

if i understand you correctly, you would like to target everything which has a substring like /15667643/ ? You do not need RegEx in this case, just a substring match.

One RegEx for this is .*/15667643/.*

If you mean an arbitrary sequence of digits you might use

.*/[0-9]+/.* for a sequence with at least one digit or
.*/[0-9]{1,12}/.* for a sequence with at least one up to twelve digits ( adjust numbers matching your needs)

Hope it helps

Kind regards

Michael



"the essence of the creative act is to see the familiar as strange." (anonymous)