Skip to main content
Level 1
September 6, 2026
Question

Can i use regular expressions while creating aep audience through segmentataion service?

Hi ,  as part of the requirement i need to check for a specific pattern of consent where i have to use regex in audience. as far as i know there is no way that i can use regular expression in audience. So, i am trying to use segmentation service where i need to use pql to achieve the same. but i am getting “ 403 Forbidden User region is missing “  error. 

Can anyone please let me know if it’s possible through segmentation api’s or can let me know why i am getting region mission error. i am giving below headers in the request.

1.Accept

2.Content-Type

3.Authorization

4.x-api-key

5.x-gw-ims-org-id

6.x-sandbox-name

7.x-request-id

 

Thanks in advance.

Usha.

    1 reply

    Prasanth
    Level 2
    October 7, 2026

    Hi ​@UshaDa 

    1. Why you are getting "403 Forbidden User region is missing"

    This error happens when Adobe's API Gateway cannot resolve the regional routing for your sandbox or credential. Try the following fixes:

    1. Check Region / Base URL: If your org is provisioned on a specific region (e.g., VA7 or NLD2), try targeting your regional host: [https://platform-va7.adobe.io](https://platform-va7.adobe.io) (or replace with your org's provisioned region).

    2. Add x-sandbox-id Header: In addition to x-sandbox-name, provide the x-sandbox-id UUID header (found in the AEP UI under Sandbox Settings).

    3. Verify API Credentials: Ensure your OAuth Server-to-Server credential has the Segment Management product profile assigned under Adobe Admin Console for the specific sandbox.

    2. Regex Support in Segmentation / PQL

    Native Regex is not supported in Profile Query Language (PQL). However, you can use PQL string functions inside your segment payload (expression.value):

    • Wildcard matching: consents.marketing.choice like "opt-in%"

    • Prefix/Suffix matching: consents.marketing.choice.startsWith("opt-in")

    • Exact options set: consents.marketing.choice.matches("opt-in|subscribed|granted")

    Alternative Recommendation: If you need complex regex parsing on raw consent strings (like IAB TCF consent string parsing), decode or extract those values into discrete fields (boolean flags or standard string fields) during Data Ingestion using Calculated Fields or Data Prep before evaluating them in Real-Time CDP segments.

    Translate