APIs & Integrations

grf1979
Contributor

Getting Contact has visited a URL that matches regular expression to work (regex)

I can’t seem to make even the most simple regular expression work in a workflow using “Contact has visited a URL that matches regular expression”.

What I want to do ultimately is to do workflow enrollment if a visitor hits a webpage containing one or more keywords (eg. cisco, vmware or salesforce). And the RegEx I thought should work is “cisco|vmware|salesforce” without the quotes. I can’t even get one keyword to work, like “cisco” (without the quotes).

I must be missing something. Any suggestions appreciated!

Some sample URLs we have:

http://www.nhknoxville.com/training-and-certifications/technical-courses/cisco

http://www.nhknoxville.com/training-and-certifications/course-outline/id/1003573985/c/salesforce-sal...

http://www.nhknoxville.com/training-and-certifications/course-outline/id/1014508556?c=dcuci-v6.0-imp...

0 Upvotes
4 Replies 4
PatrickEng
HubSpot Employee
HubSpot Employee

Getting Contact has visited a URL that matches regular expression to work (regex)

@Derek_Gervais,

What would the regular expression be if I just wanted it to be on a specific subdomain?

Right now, I'm trying to find a list of people who have viewed any of our blog posts related to chemistry. While I'm able to find anyone who views a page with chemistry in the URL, it's also picking up people who view my guide page that also has the word chemistry in it.

I tried adding the subdomain before the first period in each keyword, but that gave me no results (which either means I did it wrong or we just have no one looking at our chemistry posts).

Thanks for any help!

UPDATE: I figured it out. I was putting too much criteria in the area before the period.

div-sd
Participant

Getting Contact has visited a URL that matches regular expression to work (regex)

Hi @PatrickEng 

I realise your post is from a few years ago but I'm trying to do something similar and struggling with the regex syntax. I don't suppose you remember it?

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Getting Contact has visited a URL that matches regular expression to work (regex)

Hi @grf1979,

The regular expression for the filter must match the full URL, not just a part of it. You should be able to sandwich the terms with .* (like this: (.*cisco.*|.*vmware.*|.*salesforce.*) ) in order to match the full URLs a contact visited.

0 Upvotes
grf1979
Contributor

Getting Contact has visited a URL that matches regular expression to work (regex)

Bingo! Thanks. I wasn’t even close.