Expand my Community achievements bar.

SOLVED

Classificaton Rule Builder - Regex Help

Avatar

Level 1

Hi,

I just wanted to ask for some guidance around using regex in the Classification Rule Builder.

I have created a rule set for an eVar which is set to a string, where there can be numerous iterations of the same pattern inside. The aim is to grab the nth iteration of that pattern and then set it to a classification value based on what has been sent through.

Example of eVar value: AA-BB-CC+DD-EE-FF+.....

The delimiter above is the + sign and each value is further separated into hyphens. The 'AA-BB' or 'DD-EE' values would then hopefully be captured by the regex rule and set the classification accordingly.

I did some googling around to try and match the nth iteration of a pattern within a string but what I found out was that they weren't being set correctly, despite the match being correct.

For example:

(?:([^\+]+\+){6})(AA\-(BB|EE)\-\(.+))(?![^\+]+) - This would try to catch the 7th iteration of the pattern (non-captures the first 6 iterations followed by a +), and would ignore anything afterwards because of the negative lookahead.

The rules I created were for 1 up to 8 iterations of the above pattern and each one had a different variation of the rule to be classified (it has up to 6 different values)

The issue is that when capturing anything from the 3rd or 4th iteration onwards, some classifications would be overwritten because there would be matches further down the rule set, even if they are not supposed to match.

This is a bit of a loaded question so I do apologise, but I was hoping if there are any other examples that could help me reach some sort of resolution.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Here are a couple threads with info of some regex pattern Ideas..

https://forums.adobe.com/thread/2511817

https://forums.adobe.com/thread/2501726

I am leaning on seeing if using SAINT upload classifications is maybe a way to go(a different option).

GLTU

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Here are a couple threads with info of some regex pattern Ideas..

https://forums.adobe.com/thread/2511817

https://forums.adobe.com/thread/2501726

I am leaning on seeing if using SAINT upload classifications is maybe a way to go(a different option).

GLTU