Help Center

| Submit or View Help Requests | Developer Docs |
| |

Regex (regular expression) inside the Parentheses

Inside the parentheses

By placing part of a regex inside parentheses, you can group that part of the regex together. It captures the text matched by the regex into a group that will then be matched to the items in the actual list. The items added to the exception list (the group) and the regex between the parentheses should match so that the regex outside the parentheses can be applied to the whole list.

Note

You need to add list items that will match the regex inside the parentheses.

Example scenario

The brand “ACME Smile” would like to pay their partner 1 % per item when the customer purchases any dental brand product. ACME Smile does not have a list of SKUs for all dental products because they are constantly changing and adding new products. ACME Smile does know that all dental products start with either TOOTH, SMILETOOTH, or SHINETOOTH.

A few example SKUs are provided.

  • TOOTH112395

  • SMILETOOTH98763

  • SHINETOOTH65364

  • SHINETOOTH1123445

  • SMILETOOTH987fgdh

  • TOOTH65absv64

SKU Exception List

We know that all dental SKUs start with TOOTH, SMILETOOTH, or SHINETOOTH so we can set up a SKU exception list and use the match expression tool.

Set up an exception list

  1. From the left navigation bar, select [Menu] → Settings.

  2. Under the Exception Lists section, select SKUs.

  3. Select Add New SKU List.

  4. Enter a name for this list.

  5. Select an event type you want to associate with this exception list.

  6. If you have a list of items/values for the list, select Save and Add Items to continue.

    • If you do not have a list or the list is too large to upload you can use the match expression tool.

    • You can add List Items or you can upload a CSV or Excel file with your promo codes, SKUs, or categories.

  7. Select Save. You'll now see your new exception list on the Exception Lists screen.

Adding list items

You should add TOOTH, SMILETOOTH, and SHINETOOTH as list items.

Match Expression tool regex

Below the Advanced Settings section, you’ll want to fill out the Match Expression field.

Inside the parentheses, you would:

  • Add the 3 values that we know dental SKUs start with separated by the regex character | which means OR.

Outside the parentheses, you would:

  1. Add the regex character ^ before the first parentheses which asserts position at the start of a line.

  2. Add the regex character . after the last parentheses to match any character (except for line terminators).

  3. Add the regex character * after the period to match the previous token between zero and unlimited times.

^(TOOTH|SMILETOOTH|SHINETOOTH).*

Incoming conversion data & exception list matching

Now that you have setup a SKU exception list with the match expression tool and added the 3 list items, all incoming SKUs starting with TOOTH, SMILETOOTH, or SHINETOOTH will be considered a part of the exception list. Now you can add rules to your template terms, such as paying out $50 per order, if these SKUs are present.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.