You can use regular expressions in the filters in your reports. You can use them in the following filters:

  • Tab filters

  • Widget filters

You can use the regex filters from the dashboard by selecting the required operators.

The regex standard we follow is RE2. You can also refer to regex101 in order to test out your expressions. ;)

Regex allows you to create powerful pattern-based filters. To illustrate this, we'll take a sample campaign naming structure. Below are the sample campaign names we will be working with.

As you might notice, the expected campaign naming structure we're following here is:

<Campaign ID>_<Campaign Platform>_<Campaign Category>_<Campaign Targeting>_<Campaign Channel>

We can use regex filters on such a dataset for several use cases.

1. Apply OR conditions in a single filter

We can also use regex to apply OR filters in a single filter as follows:

Campaign    contains (regex)    AND|BRA

This looks for all campaigns with either the string AND or BRA in the names. For our list of campaigns above, this would filter out: 132312412_AND_Chamku Shoes_RET_Facebook and ALL_Relaxo Jeans_BRA_Google Ads.

2. Filter for attributes from the campaigns

We can use a regex pattern to filter out campaigns containing specific values for 2 attributes. For example, if we want to filter out the campaigns which contain AND and RET in their names, the filter for this can be:

Campaign     contains (regex)     .*_AND_.*_RET_.*

This cannot be currently done in Clarisights in a single filter without using regex.

3. Check if campaigns are following the naming convention

We can use a regex to filter out all the campaigns which do not follow the above naming convention. The filter for this can be:

Campaign    does not contain (regex)    [0-9]*_(AND|WEB|IOS|ALL)_[a-zA-Z ]*_(RET|UA|BRA_Facebook|Google|Apple)

Here, we are making some assumptions about the possible values of our campaign attributes (as shown above) based on which we can check if there's any campaign that does not match our expected structure.

Note

Please keep in mind the following points while using regex filters:

  • A normal contains filter will result in faster queries than using regex contains, so you should try to use those as much as possible for lower report latency

  • This filter is case insensitive
    For example, if we have the following sample campaigns:

    Here, if you filter as:

    Campaign        contains        web

    Then the system would filter for both the above campaigns.

We hope this is enough to get you started with using regex filters for your use cases! Please contact Clarisights support if you need any further help in using them!

Did this answer your question?