Regular expressions, or regex, are pattern-matching rules used to search, validate, and filter text. In ESS, the regExp operator can be used in Matching Criteria under Topic Subscriptions to match text-based fields using flexible string patterns.
ESS supports regExp as an operator in the Matching Criteria field under New Topic Subscriptions. This allows users to define advanced matching logic for text values, such as keywords, case-insensitive phrases, or exact text patterns.
This is useful when you want to:
- Match specific keywords in message content
- Handle uppercase and lowercase variations
- Allow or restrict whitespace
- Define more precise filtering behavior than simple exact matching
Where regExp Can Be Used
You can use regExp in:
- New subscriptions
- Existing subscriptions during edit/update
Navigation path:
- Create new subscription:
SDC UI -> Event Manager -> Subscriptions -> New subscription - Update existing subscription:
SDC UI -> Event Manager -> Subscriptions -> View -> Edit subscription
When defining Matching Criteria, select regExp from the operator dropdown.
Important Limitations
Before using regExp, keep these limitations in mind:
- There is no validation in the SDC UI for invalid regex patterns.
- Users are expected to validate regex syntax externally before saving.
- regExp can only be used in Matching Criteria.
- regExp can only be used with Text fields.
- If regExp is applied to a non-text field, the backend throws an error.
Example:
Let's setup a matching criteria for the below webhook requirement
| Keyword Group | Keywords, non-case-sensitive |
| STOP | "STOP","STOPALL","UNSUBSCRIBE","CANCEL SUBSCRIPTION","DON'T TEXT ME","NO MORE TEXTS","STOP MESSAGES" |
In this case the matching criteria must be:
message_body regExp '(?i)STOP|UNSUBSCRIBE|CANCEL SUBSCRIPTION|DON.T TEXT ME|NO MORE TEXTS|STOP MESSAGES'
This matching criteria will filter the webhooks to be only the MOs messages that match the regExp specified in the Matching Criteria field.
The regExp operator in ESS Matching Criteria gives you a powerful way to control how subscriptions match message content. It is especially useful for keyword recognition, opt-out handling, and exact phrase detection. Because the UI does not validate regex syntax, always test your pattern externally before using it in production.
0 Comments