How can I use regular expressions to search for specific campaigns/ad set/ads?

Regular expressions are used to search for text elements contained in a variable.

Sometimes, when working with a patch node or a filter node, you would like to use a regex match.

 

This can, for example, be when you want to trigger a notification only for campaigns that could contain some text.

Here are different ways of using matched regex:

Example 1: Filter campaign that contains any of the names

In this example, we want to first filter for campaigns that contain testing, creative or test-crea

→ Use the regular expression: (?i)(name1|name2|name3)

Notion image
💡
by using (?i) in the regular expressions the name will be returned no matter if it’s upper or lower cases

Example 2: Filter campaign name that contains “name1” and then “name2”

In this example, we want to first filter for campaigns that contain engagement and also contain march within any number of characters in between.

Eg: _____engagement_______march____

→ Use the regular expression: name1.*name2

 
Notion image
Did this answer your question?
😞
😐
🤩

Last updated on March 23, 2023