Help Center

| Submit or View Help Requests | Developer Docs |

View desktop instructions
View mobile app instructions
Regex Inside the Parentheses

Regex (or Regular Expression) is a type of code you can use when you want to match a portion of the characters in your uploaded product SKUs, categories, or promo codes with the values that are passed to impact.com with conversions. You can use regex with impact.com's Match Expression tool to identify product SKUs, categories, or promo codes for which you want to pay out differently.

Inside the parentheses

By placing part of a regex inside parentheses, you can group that part of the regex together. The Match Expression tool can then extract the values you place between the brackets and find a match in the accompanying exception list items you provide. The items you add to the exception list should exactly match the regex between the parentheses so that the regex outside the parentheses can be applied to the whole list.

Example scenario

Your brand, ACME Smile, would like to pay out 5% to partners when a customer purchases any dental product. ACME Smile doesn't have a comprehensive list of SKUs for all dental products, because your brand is constantly removing products and adding new ones. However, you do know that all dental product SKUs start with either TOOTH, SMILE, or SHINE (e.g. SHINE98763, SMILE987abc, TOOTH65abc64).

Because all dental SKUs start with TOOTH, SMILE, or SHINE, you can set up a regex for dental product SKUs in general, and use the Match Expression tool to find matches in an incomplete SKU exception list, as demonstrated in the following sections.

Step 1: Create a SKU list

  1. From the left navigation bar, select ellipsis-v-solid.svg [Menu] → Settings.

  2. Under the Exception Lists section, select SKU.

  3. Select Add New SKU List.

  4. Enter a List Name.

  5. Select the event type you want to associate with this SKU list.

Step 2: Set up the regex

  1. Select Show advanced settings and enter your regex in the Match Expression field.

    • Inside parentheses, add only the values for which you want to match:

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

    • Outside the parentheses, add any regex that helps refine your match:

      • Add the regex character ^ before the opening parentheses to assert the position at the start of the line, ensuring that there are no preceding characters..

      • Add the regex character . after the closing parentheses to match for any following characters (e.g., numerals, letters, hyphens) except for line terminators.

      • Add the regex character * after the period to look for any number of matches (i.e., between 0 and unlimited matches).

    • The final expression should be ^(TOOTH|SMILE|SHINE).*.

  2. Select Save and Add items.

    Screenshot_2024-07-29_at_4_23_38_PM.png

Step 3: Add exception list items

  1. List the values you want to match in 1 of 2 ways:

    • Add Items manually by entering TOOTH, SMILE, and SHINE in the Sku fields.

      Screenshot_2024-07-29_at_4_29_01_PM.png
    • Upload a CSV or Excel file listing TOOTH, SMILE, and SHINE under the SKU column.

      Screenshot_2024-07-29_at_4_33_14_PM.png
  2. Select Save.

    • You'll see your new SKU list on the SKU Lists screen.

What next?

Now that you've set up a regex Match Expression and added the 3 SKU list items, all ACME Smile's future dental products (assuming they also have SKUs starting with TOOTH, SMILE, or SHINE) will be matched as part of the exception list. Any incoming conversions that match the regex will be flagged as part of the exception list and contract rules will be applied accordingly.

Now you can add rules to ACME Smile's template terms, such as paying out 5% per order whenever these SKUs are present. See Set payouts for a SKU exception list for more details.

Did you find it helpful? Yes No

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