Expand my Community achievements bar.

Join us January 15th for an AMA with Champion Achaia Walton, who will be talking about her article on Event-Based Reporting and Measuring Content Groups!
SOLVED

How to split String with Classification Rules (Regex)

Avatar

Level 9

Hello guys,

Anyone can help to split 1 string as b1cdc3168772ce4a79ba2db0cfeba174#recdc3168772ce4a79ba2db0cfeba123#.... into a multiple sub customerId?

 

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 4

Assuming the "#" character is your delimiter, an example regex for THREE id values would be

([^#]+)#?([^#]+)?#?([^#]+)?

 

And if you have 3 classifications, called something like "FirstID", "SecondID", and "ThirdID", you'd set the values for them in the rule builder as $1, $2, and $3 respectively

 

jgrubbs_0-1644503636037.png

 

View solution in original post

3 Replies

Avatar

Community Advisor and Adobe Champion

@Luca_Lattarini Classification Rules using Regex typically work by identifying certain patterns.  What specific pattern(s) are you wanting to recognize in order to then "normalize" split things out and/or return different data in your Report Suite?
For instance, you can actually have your Regex split on the hashtags or a specific sets of numbers.  It all depends on your criteria.

Avatar

Correct answer by
Level 4

Assuming the "#" character is your delimiter, an example regex for THREE id values would be

([^#]+)#?([^#]+)?#?([^#]+)?

 

And if you have 3 classifications, called something like "FirstID", "SecondID", and "ThirdID", you'd set the values for them in the rule builder as $1, $2, and $3 respectively

 

jgrubbs_0-1644503636037.png

 

Avatar

Community Advisor and Adobe Champion

So, the first thing I always like do is use a tool like Rubular to play around with these things to prove them out, and I'm not sure if you're going to be able to get your example to work out there.  However, if this DOES work within Adobe, then more power to you.    Adobe Analytics likes to do its own things sometimes.