Classificaton Rule Builder - Regex Help

rahulg59969364

18-12-2018

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.

Accepted Solutions (1)

Accepted Solutions (1)

Answers (0)